好的:
在svn和bzr中,我可以分支,提交,合并,我的提交历史记录将如下所示:
41: Theodore R. Smith 2013-09-14 Jump to list by name instead of number.
40: Theodore R. Smith 2013-09-14 [merge] [m] Miscellaneous cleanups.
39.1.4: Theodore R. Smith 2013-09-14 [m] Removed old files.
39.1.3: Theodore R. Smith 2013-09-14 [m] Fixed bug where test could not...
39.1.2: Theodore R. Smith 2013-09-14 [m] Fixed a CSS layout bug from th...
39.1.1: Theodore R. Smith 2013-09-14 [m] Fixed a typo.
39: Theodore R. Smith 2013-09-14 Added a progress bar.
38: Theodore R. Smith 2013-09-14 [merge] Updated the core libraries.
37.1.3: Theodore R. Smith 2013-09-14 Updated HTML Kickstarter.
37.1.2: Theodore R. Smith 2013-09-14 Upgraded to from jQuery 1.8.3 to 2.0.3.
37.1.1: Theodore R. Smith 2013-09-14 Upgraded to jQuery Address v1.6.
如果我不想扩展历史,我可以:
41: Theodore R. Smith 2013-09-14 Jump to list by name instead of number.
40: Theodore R. Smith 2013-09-14 [merge] [m] Miscellaneous cleanups.
39: Theodore R. Smith 2013-09-14 Added a progress bar.
38: Theodore R. Smith 2013-09-14 [merge] Updated the core libraries.
在任何时候,我都可以通过bzr diff -r37.1.2..37.1.3
轻松获取各个合并提交完全的差异等。
重要的是我的分支历史记录保留,我的主线提交历史记录不受次要功能提交的污染。
现在,每当我在git中进行功能合并时,无论是否有--no-ff
,我都会在提交历史记录中获得以下内容:
<hash>: Theodore R. Smith 2013-09-14 Jump to list by name instead of number.
<hash>: Theodore R. Smith 2013-09-14 [merge] [m] Miscellaneous cleanups.
<hash>: Theodore R. Smith 2013-09-14 [m] Removed old files.
<hash>: Theodore R. Smith 2013-09-14 Added a progress bar.
<hash>: Theodore R. Smith 2013-09-14 [m] Fixed bug where test could not...
<hash>: Theodore R. Smith 2013-09-14 [merge] Updated the core libraries.
<hash>: Theodore R. Smith 2013-09-14 [m] Fixed a CSS layout bug from th...
<hash>: Theodore R. Smith 2013-09-14 Updated HTML Kickstarter.
<hash>: Theodore R. Smith 2013-09-14 [m] Fixed a typo.
<hash>: Theodore R. Smith 2013-09-14 Upgraded to from jQuery 1.8.3 to 2.0.3.
<hash>: Theodore R. Smith 2013-09-14 Upgraded to jQuery Address v1.6.
我的问题很多。
我想要一个解决方案
git rebase
不在图片中,git merge --squash
也是如此。git log
。感谢您帮助我理解这个过于复杂的程序!
答案 0 :(得分:11)
Git和Bazaar的图形完全相同,我知道因为我写了Git的官方Bazaar桥,唯一的区别是图表是如何通过log
命令呈现的。
git log
有很多选项,因此可以准确指定您希望如何呈现该图表。
看起来你想要的是这个:
git log --oneline --graph
将以与bzr log
类似的方式向您显示合并:
* eaaec50 Merge git://github.com/git-l10n/git-po
|\
| * 1b5f46f l10n: Add reference for french translation team
| * 6b388fc l10n: fr.po: 821/2112 messages translated
* | 2809258 Merge branch 'sb/mailmap-updates'
|\ \
| * | cdb6b5a .mailmap: Combine more (name, email) to individual persons
| * | 10813e0 .mailmap: update long-lost friends with multiple defunct addresses
* | | 8ed205a git-remote-mediawiki: ignore generated git-mw
| |/
|/|
* | 96cb27a Merge branch 'maint'
您也可以完全忽略“次要提交”
git log --oneline --first-parent
eaaec50 Merge git://github.com/git-l10n/git-po
2809258 Merge branch 'sb/mailmap-updates'
8ed205a git-remote-mediawiki: ignore generated git-mw
96cb27a Merge branch 'maint'
如果您厌倦了键入所有这些选项,则可以配置别名:
git config --global alias.l 'log --oneline --graph'
因此您只需输入git l
。