Git合并日志不同
问题描述:
我使用GitKraken来查看我的工作树,并学习如何git分支和合并。Git合并日志不同
场景:我有一个工作大师,但必须执行错误修正。
git branch Hotfix #Create a new branch for the hotfix
git checkout Hotfix #Move to Hotfix branch
git commit NowGoodFile.cs -m "Add test tools" #Make changes
git checkout master #Checkout master
git merge Hotfix #Merge Hotfix into the master
一步的,我想什么步骤发生:
- 我有一个主 - 工作,却发现了一个错误:
- 我创建分支,
Hotfix
,进行我的更改:
- 我然后合并这些变化到主:
但这不是我做git merge Hotfix
会发生什么。我得到这个:
我应该怎么写merge into
影响?
答
默认情况下git merge
使一个快进合并时有可能。你期望的是true merge
,可以通过--no-ff
或merge.ff
设置为false
来完成。
我想要快进吗?根据[Atlassian的(https://www.atlassian.com/git/tutorials/using-branches/git-merge): > ...许多开发人员喜欢使用快进...并轨小的特性或错误修复,同时保留3路合并以集成更长时间运行的功能。 –
@RasmusBækgaard它取决于。我个人更喜欢快进合并,并且总是试图为发布分支创建线性历史记录。 – ElpieKay
太好了 - 谢谢! –