净化Git之rebase变基的使用
git rebase能够将分叉的分支重新合并,之前写过一篇文章介绍它的原理,下面主要介绍它的两个使用场景: 场景一:本地与远端同一分支提交历史不一致 方式一 多个人在同一个分支上协作时,出现冲突是很正常的,比如现在有一个项目由我和A一同开发。 我在修复了一个bug以后准备提交 HowiedeiMac:ganlin howie$ git add models/paper.go HowiedeiMac:ganlin howie$ git commit -m 'fix a bug' [master 8b76654] fix a bug 1 file changed, 3 insertions(+), 3 deletions(-) 现在准备推送到远端 HowiedeiMac:ganlin howie$ git push origin master To https://gitee.com/greenhn/ganlin.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://gitee.com/greenhn/ganlin.git' hint: Updates were rejected because the remote contains work that