• git命令备忘


    git config --global credential.helper store
    git checkout -b 本地分支名x origin/远程分支名x
    git fetch origin 远程分支名x:本地分支名x
    git checkout master //切换分支
    git stash 
    git fetch
    git pull
    git reset --hard <版本号> // 注意使用 --hard 参数会抛弃当前工作区的修改
    git reset --sort // 使用 --soft 参数的话会回退到之前的版本,但是保留当前工作区的修改,可以重新提交
    git push origin <分支名> --force // 强制push
    git commit --amend // 修改注释

    git fetch -p 更新远程分支,包括删除

    git push -u origin master

    ==============================================

    git 撤销push 

    git reset --hard 版本号

    git push origin <分支名> --force

    ==============================================

    git 复制分支到新的分支

    git cherry-pick commitId,如果有冲突 git cherry-pick --continue,git push

    ----------------------------------------------------------------------------------------------------------------------------------------------

    git 撤销push
    https://blog.csdn.net/xs20691718/article/details/51901161
    https://blog.csdn.net/guozhaohui628/article/details/78922946

    git 复制分支到新的分支 https://blog.csdn.net/shiki_41/article/details/80352029

    ----------------------------------------------------------------------------------------------------------------------------------------------

    Perhaps you should specify a branch such as 'master'.

    git push origin master

    git branch --set-upstream-to=origin/master

    git branch --set-upstream-to=xxx/develop master

    ----------------------------------------------------------------------------------------------------------------------------------------------

    git如何合并远程2个分支 https://blog.csdn.net/tmacsky/article/details/78795894

    git push -f https://www.jianshu.com/p/b03bb5f75250 

  • 相关阅读:
    三方登录微博url接口
    微博三方登录流程 (原理)
    celery配置与基本使用
    spring 验证框架
    IDEA 插件整理
    spring security笔记 默认登陆页面源码
    EXTJS7 自定义日期时间选择输入框
    EXTJS7 combobox本地模式 动态修改选项
    EXTJS7 combobox 下拉加载数据源码
    nginx 反向代理端口号丢失处理
  • 原文地址:https://www.cnblogs.com/cdfive2018/p/9164684.html
Copyright © 2020-2023  润新知