Why I do not need to commit after git merge

I have a repo wizard and I am doing file1.txt and file2.txt with files

git checkout -b fix1

Then I change file1.txt

and i do

git commit -a

then i do

git checkout master

then i do

git checkout -b fix2

Then I modify the file2.txt

and i do

git commit -a

then git checkout master a

git merge fix1
git marge fix2 

but if i do

 commit -a 

I get

# On branch master
nothing to commit (working directory clean)
+5
source share
3 answers

git mergeautomatically fixed. If you do not want to comment, add the argument --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.
+8
source

If the merge succeeds without conflict, git will automatically commit it (which you can verify by simply checking git log).

Documentation Notes (emphasis added):

... "git " , , (.. E) , (C) , ,

, --no-commit:

git merge --no-commit fix1
+3

Merged files that do not have conflicts are already merged. You can directly click your merged files.

+1
source

All Articles