Reputation: 531
I have a SourceTree issue with moving between branches due to file conflicts. Basically I am working in a small team and we each have our own Web.config files which have distinct properties to our individual machines (like directory paths eg. C:/Mark/Documents/Project/) Each time I move between branches I have conflicts because of these files. I do not want to commit these files because it means when someone else moves to that branch they will need to commit their Web.config changes - which means when I return to it I will need to commit the files again, and so on. Is there some Git tool or procedure I can use to get around this issue we are having.
Thanks in advance
Upvotes: 0
Views: 31
Reputation: 30888
I guess that file is modified by someone or by something, but not committed before you switch to another branch. Make the work tree clean before switching. Discard the changes of that file if they are not needed via git checkout -- <path_of_that_file>
. Commit them if they are needed. Run git status
to see if the work tree is clean.
Upvotes: 0
Reputation: 8111
If I understand you correctly all you need to do is add Web.config
to your .gitignore
.
That will prevent git from tracking changes to the file. Each user can do whatever they like to it without creating conflicts.
Upvotes: 1