0

I have a master repository that is used by two users, now when I push my code it warns me to resolve conflicts.

I want to merge my code into the existing code with git commands but I don't know how to fix this problem.

jonrsharpe
  • 107,083
  • 22
  • 201
  • 376
Hassan Farooq
  • 61
  • 1
  • 12
  • 3
    Possible duplicate of [How to resolve merge conflicts in Git?](http://stackoverflow.com/questions/161813/how-to-resolve-merge-conflicts-in-git) – jonrsharpe Nov 25 '16 at 08:12

1 Answers1

1
$ git commit -am <message>       # add & commit your local changes
$ git pull origin master         # pull the latest codes
$ git status                     # see the files that have conflicted (untracked files)

# If you want to keep your changes then
$ git checkout . --ours

# Or, if you want to keep remote changes
$ git checkout . --theirs

$ git commit -am <message>           # add & commit with a new message
$ git push origin master             # push to remote  
Sajib Khan
  • 20,492
  • 6
  • 56
  • 69