查看本地分支和远程分支列表:
git branch -a
新建本地分支并关联远程分支:
git checkout -b 本地分支名 远程分支名
切换分支:
git branch 分支名称
删除本地分支:
git branch -d 本地分支名
删除远程分支:
git push origin --delete 远程分支名
如果remotes分支不是在不是在origin下(比如在upstream下),得把origin换成upstream
删除本地所有修改:
git checkout .
更新远程分支列表:
git fetch origin --prune
如果remotes分支不是在不是在origin下(比如在upstream下),得把origin换成upstream
提交到远程分支:
git push -u origin 远程分支名
如果remotes分支不是在不是在origin下(比如在upstream下),得把origin换成upstream
撤销commit:
https://git-scm.com/book/zh/v1/Git-基础-撤消操作
git文档:
https://git-scm.com/book/zh/v2
git 提示:
Pleasemake sure you have the correct access rights and the repository exists.
可能原因为SSH KEY有问题,连不上服务器。
解决方案:重新生成SSH KEY
https://blog.csdn.net/jingtingfengguo/article/details/51892864
git报错:
git拉取分支报错:fatal:‘XXX' is not a commit and a branch ‘XXX' cannot be created from it
https://yq.aliyun.com/articles/690706