What is the difference between `git merge` and `git merge --no-ff`?
使用
不管一个人多,你想occasionally防止from this行为发生,因为你想在maintain typically特异性分支拓扑(例如你得以在话题你想确保它分北路,当阅读历史)。以do that the
如果你想similarly execute,或使用在
图形回答这问题
这里是网站与明确的解释》插图和图形git of using ff:MERGE -不行P></
P></
直到我看到这,我完全失去了与Git。使用 -不- ff allows输入分支历史clearly see the reviewing to You checked超时工作。(that to github' S点"网络链接"工具来可视化和is another)与illustrations大参考。很好很好的一本参考complements with the first of a more with less焦点的那些acquainted Git。P></我newbs信息类Basic for
如果你是像我和我不是大师,我在这里回答Git Describes the,of files from删除处理git' deleting them from the s跟踪没有本地文件系统,但它似乎poorly documented经常共生。另一个情况是,让newb流队列,manages to which仍然回避我。P></工作流实例
在包装的最新网站,我和我去看我的back to My Notes工作流;EN useful to add an example思想这一答案。P></
我的工作流Git命令:ofP></
1 2 3 4 5 6 7 8 | git checkout -b contact-form (do your work on"contact-form") git status git commit -am "updated form in contact module" git checkout master git merge --no-ff contact-form git branch -d contact-form git push origin master |
实际的使用,包括:explanations below。注:snipped Git below is the输出;是那么冗长。P></
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | $ git status # On branch master # Changed but not updated: # (use"git add/rm <file>..." to update what will be committed) # (use"git checkout -- <file>..." to discard changes in working directory) # # modified: ecc/Desktop.php # modified: ecc/Mobile.php # deleted: ecc/ecc-config.php # modified: ecc/readme.txt # modified: ecc/test.php # deleted: passthru-adapter.igs # deleted: shop/mickey/index.php # # Untracked files: # (use"git add <file>..." to include in what will be committed) # # ecc/upgrade.php # ecc/webgility-config.php # ecc/webgility-config.php.bak # ecc/webgility-magento.php |
3)注意:from above1)You can see the changes the输出等package' from the of the之外的升级,包括新的文件。there are also通知2)两个(not in the
Rather below:做的比我的normally
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | $ git checkout -b ecc $ git add ecc/* $ git reset HEAD passthru-adapter.igs $ git reset HEAD shop/mickey/index.php Unstaged changes after reset: M passthru-adapter.igs M shop/mickey/index.php $ git commit -m"Webgility ecc desktop connector files; integrates with Quickbooks" $ git checkout master D passthru-adapter.igs D shop/mickey/index.php Switched to branch 'master' $ git merge --no-ff ecc $ git branch -d ecc Deleted branch ecc (was 98269a2). $ git push origin master Counting objects: 22, done. Delta compression using up to 4 threads. Compressing objects: 100% (14/14), done. Writing objects: 100% (14/14), 59.00 KiB, done. Total 14 (delta 10), reused 0 (delta 0) To [email protected]:me/mywebsite.git 8a0d9ec..333eff5 master -> master |
P></脚本automating for the above
有10 + used this process时报have taken to a Day,写作to execute the scripts的批处理命令,几乎我自制的安真
编辑:此图像的早期版本只指示合并提交的单个父级。合并提交具有多个父提交,Git使用这些父提交来维护"功能分支"和原始分支的历史记录。多个父链接以绿色突出显示。
合并策略
- 显式、非快速向前合并
- 通过REBASE或快进合并隐式
- 合并壁球
重新平衡:建立新的基准面
快进:快进
挤压:用力挤压或挤压(某物)使其变平。
这是一个古老的问题,在其他文章中有一些微妙的提到,但是让我点击这个按钮的原因是非快速前进的合并需要单独的提交。