是否有可能做一个“混帐合并”,但没有提交?没有自动提交的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