kni*_*ttl 10
您可以创建一个新的分支(我们称之为bugfix-a在合并基础)master和production
git checkout -b bugfix-a $(git merge-base master production)
Run Code Online (Sandbox Code Playgroud)
在该分支中应用您的错误修复程序
>>/path/to/file echo 'this fixes the bug'
git add /path/to/file
git commit -m 'important bugfix'
Run Code Online (Sandbox Code Playgroud)
然后,将这个新分支合并到master和production:
git checkout master
git merge bugfix-a
git checkout production
git merge bugfix-a
Run Code Online (Sandbox Code Playgroud)
这样你就可以在以后合并master和production,Git会聪明地知道要选择哪些提交.
(Monotone - 是的,它不是Git - 称这个工作流程为daggy修复)