每次修改程序时
最好先同步代码,在最新的代码上修改,这样提交时就不会有冲突
git fetch origin
git reset --hard m/master
在切换到到要修改的分支上
git checkout -b RL_master m/master
但是有时没有同步也没有切换分支,提交时发现都没有 分支 怎么办呢?
git checkout RL_master
出现下面以打印信息:
Warning: you are leaving 1 commit behind, not connected to
any of your branches:
ccf1f7b add new app for e675-16-ts
If you want to keep them by creating a new branch, this may be a good time
to do so with:
git branch new_branch_name ccf1f7b128d16d7b85d57acc9e251d9390a75467
Switched to branch 'RL_master'
Your branch is behind 'origin/RL_master' by 41 commits, and can be fast-forwarded.
接着
git branch a ccf1f7b128d16d7b85d57acc9e251d9390a75467
然后再切换到分支:
git checkout RL_master
git fetch origin
git reset --hard m/master
git cherry-pick ccf1f7b128d16d7b85d57acc9e251d9390a75467
或者 git merge a也可以
阅读(3023) | 评论(0) | 转发(1) |