是否有可能做一个git merge
,但没有提交?
“man git merge”是这样说的:
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 merge
和--no-commit
时,它仍然自动提交。以下是我所做的:
$> ~/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)
随后的git log
显示了从v1.0分支合并到主分支的所有提交。