0

I went through lots of git stuff and stackoverflow answers before asking this question but still I could not find an answer. Last link I followed is : How do I resolve git saying "Commit your changes or stash them before you can merge"?

My Scenario is , I pull new changes to local copy but there is a conflict. My local copy has new changes which I need to commit and repository file also have some changes (same file) which I need to update.

Please help me to find a solution for this. Thanks in advance.

user2490093
  • 69
  • 10

1 Answers1

0

In these cases, you need to fix the conflicts manually. Running git status will list the conflicted files. Open them in your IDE or a text editor and you'll find regions that look like this

<<<<<<< HEAD  
code..  
=======  
more code...  
>>>>>>> some commit number  

These are the conflicting regions. Go through all of them and manually merge them by editing the source yourself. Then use git add <file> to mark the file as conflict free. Repeat this for every file that git status listed as having conflicts. Finally run git commit.

Daomephsta
  • 16
  • 3
  • I back up new changes and manually update the file.. Then added my changes and commit.. Your method worked..Thank you very much – user2490093 Jan 25 '18 at 02:36