【发布时间】:2016-03-29 16:50:13
【问题描述】:
我最近在一个网络项目中遇到了这个问题:
git branch new-feature
git checkout new-feature
hack hack hack...
“老板:嘿,master 有一个 bug 需要修复,马上!”
git commit -a -m "Partially completed migration changes"
git checkout master
git branch bugfix
git checkout bugfix
hack hack hack... 测试测试测试...
“好的,解决了!”
git checkout master
git merge bugfix
继续完成功能,但我们不要重新引入错误...
git checkout new-feature
git rebase master
First, rewinding head to replay your work on top of it...
Applying: some commit info
Using index info to reconstruct a base tree...
...
Auto-merging /some/buggy/file
CONFLICT (content): /some/buggy/file
Auto-merging /some/buggy/file
CONFLICT (content): /some/buggy/file2
Auto-merging /some/buggy/file
CONFLICT (content): /some/buggy/file3
...
如果我碰巧知道特定文件与新功能无关,我如何以交互方式强制文件从变基源复制?
有没有办法告诉git 提示我:
copy /some/buggy/file master? y/n
copy /some/buggy/file2 master? y/n
...
【问题讨论】: