git的一些常用命令
取消合并:
git reset --merge
合并加注释:
git merge origin/master -m "xxx"
后面撤回前的一个分支的commit
git reset --soft 48aa44796596a7839df7e534500e6c5677b6571c
本地撤回后,让远程分支撤回
git push --force
删除本地分支与对应的远程分支:
切换到非删除分支,
git push --delete origin 远程分支名
git branch -d 本地分支名
git branch -D 本地分支名
其他
git pull 或者 git push的时候报错——
There is no tracking information for the current branch.
Please specify which branch you want to rebase against.
See git-pull(1) for details.git pull
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/ examine
出现这种问题的原因是因为:本地分支没有与远程分支建立联系
按照提示,输入如下命令:
(本地分支叫dev,远程分支是dev)
git branch --set-upstream-to=origin/dev dev
其他文章推荐
主要介绍了git远程仓库的克隆、仓库更换推送、远程仓库查看、分支创建、分支推送、分支拉取、分支查看、分支合并、分支删除、分支切换