TortoiseGit un-checking the files will be submit the file to repository by default?

73 Views Asked by At

Here is my scenario:

I want to resolve a conflict in my repository and, in the same time, I also want to let the user to be able to commit other files without having to commit the resolved file. I tried the following:

  1. git status: 1.txt(conflict) 2.txt(modify)

  2. git resolve: 1.txt(modify) resolve the conflict

  3. git commit 2.txt //Only commit 2.txt

  4. git show log : 1.txt(modify) 2.txt(modify)

On the submission list, I only submitted 2.txt, but when viewing the log, 1.txt was submitted by default, why is this happening, and at the same time, the file status of 1.txt is still modify, how to parse this, I am a bit confused? Thanks in advance for your help!

3

There are 3 best solutions below

0
On

Conflicts always need to be resolved before committing.

If you unselect a file then the changes are not part of the commit, i.e. the file stays in the unmerged version in the commit.

0
On

I checked the source code of TortoiseGit and found that it restored the unchecked files after submission

2
On

You need to navigate to the file currently modified, in your case 1.txt(modify)

you will notice in this file Git has added something similar to <<<<<<head>>>>>> This will show you where the current origin is, and then your current change underneath it.

Please Make sure you have resolved this conflict by deleting the correct set of code in the outlined file. After you do this you can continue with your commit.

Hope this helps