Git error fatal: cannot do a partial commit during a merge
Hello guys, I have a small project with .Net Core 3.1 and I push my project into GitLab.
Today I have resolved a conflict source code, I used git commit to helping commit all source change into git but I got an error fatal: cannot do a partial commit during a merge. Like this:
E:\Project\Quiz\Main\Admin\Source\frontend (Sprint_3_0110_2220/tool_auto_bump -> origin)
λ git commit -m 'merge conflic'
fatal: cannot do a partial commit during a merge.
Before running git commit
I ran git add .
but it still throws the error.
Does anyone have any idea for me?
Thanks for any suggestions.
-
r1
ram Nov 21 2021
I'm not sure about this case but after I running as below:
- Run
git pull
- Run
git add .
- Run
git commit -m "Commit code"
- Finally, run
git push
And it really worked for me.
- Run
-
A0
Armin Habibi Nov 21 2021
You can try to commit all changed files with the command:
git commit -a
Don't forget, you have to run the command
git add .
before.
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.