是否有可能做一個「混帳合併」,但沒有提交?沒有自動提交的git合併
「人混帳合併」這樣說:
With --no-commit perform the merge but pretend the merge failed and do not autocommit,
to give the user a chance to inspect and further tweak the merge result before
committing.
但是,當我嘗試使用git與合併仍然--no提交它的自動提交。下面是我所做的:
$> ~/git/testrepo$ git checkout master
Switched to branch 'master'
$> ~/git/testrepo$ git branch
* master
v1.0
$> ~/git/testrepo$ git merge --no-commit v1.0
Updating c0c9fd2..18fa02c
Fast-forward
file1 | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
$> ~/git/testrepo$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
隨後的「混帳日誌」顯示所有從1.0分支提交合併成高手。
如果有任何疑問,該怎麼辦? – Michelle 2015-01-03 05:06:42
@PineappleUndertheSea快進不會導致衝突。如果「真正」合併而沒有快速轉發,'--no-commit'開關僅在沒有衝突發生時纔有效,如果發生衝突,git將永遠不會自動提交。 – gronostaj 2015-01-05 19:20:21
供參考:如果您想要合併更改,然後提交_as,如果您手動鍵入了所有in_合併的更改(與傳統合並相反),則需要運行'rm。git/MERGE_HEAD',這會迫使git忘記合併發生了。 – Jonn 2016-02-27 00:23:23