为什么我不必在git merge之后提交

tec*_*013 8 git git-merge

我有一个repo master,我使用file1.txt和file2.txt

git checkout -b fix1
Run Code Online (Sandbox Code Playgroud)

然后我改变file1.txt

而且我做了

git commit -a
Run Code Online (Sandbox Code Playgroud)

然后我做了

git checkout master
Run Code Online (Sandbox Code Playgroud)

然后我做了

git checkout -b fix2
Run Code Online (Sandbox Code Playgroud)

然后我改变file2.txt

而且我做了

git commit -a
Run Code Online (Sandbox Code Playgroud)

然后git checkout master

git merge fix1
git marge fix2 
Run Code Online (Sandbox Code Playgroud)

但如果我做了

 commit -a 
Run Code Online (Sandbox Code Playgroud)

我明白了

# On branch master
nothing to commit (working directory clean)

Som*_*ude 11

git merge自动提交.如果您不想提交添加--no-commit参数:

  --commit, --no-commit
      Perform the merge and commit the result. This option can be used to override --no-commit.

      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.
Run Code Online (Sandbox Code Playgroud)