0

I am using git through visual studio to push and pull the code from git repository. A team of three people are at present using the same repository. One of my colleague has accidentally pushed bin and obj folders of the project. (there is anothe problem where in the bin and obj folders does not get excluded even though we tried all possible combinations of it in gitignore file). So when I tried to pull the updates today, I have ran into a solution where in I am getting 729 conflicts. Out of which 2 code files are having conflicts which I have resolved, but there are remaining 727 files which I want to keep local files.

In visual studio I get a option to choose either to keep local to take remote file. But unfortunately there is no select option for that. Which means if have to resolve the conflicts I have to manually choose if I have to choose either to keep local or take remote for 727 files (which is nearly impossible).

I do not want to loose my changes as well as do not want to loose the resolved files(2 files out of 729). Any help would be greatly appreciated.

enter image description here

2
  • 1
    Were your changes committed (before the merge)? Commented Apr 6, 2018 at 10:23
  • yes it was comitted
    – Arti
    Commented Apr 6, 2018 at 10:27

1 Answer 1

0

You can checkout all the conflicted files from the terminal with something like this.

git checkout --ours **/bin/**
git checkout --ours **/obj/**

Just make sure the glob is correct. And be carful if you are using git pull --rebase you need to use --theirs
From the documentation:

Note that during git rebase and git pull --rebase, ours and theirs may appear swapped; --ours gives the version from the branch the changes are rebased onto, while --theirs gives the version from the branch that holds your work that is being rebased.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.