1

I am new to git and am trying to push origin/master into master, problem is need to resolve conflicts. I do not know what the right option is here, I just want the code I have to be pushed to the main branch. Can anyone help me out quick?

enter image description here

Aaron
  • 7,055
  • 2
  • 38
  • 53
ShedSports
  • 541
  • 2
  • 7
  • 14
  • 1
    Does this answer your question? [How to resolve merge conflicts in Git?](https://stackoverflow.com/questions/161813/how-to-resolve-merge-conflicts-in-git) – 1615903 Sep 09 '20 at 04:12

1 Answers1

2

A merge conflict happens when the two repositories (in this case your remote origin/master and your local master) have both been changed in different ways since they were last in sync. It's nothing to panic about, all it's asking you is which one is the correct one. If you know that origin/master, for example, is the correct one, then just choose that option from the dropdown there.

If you are unsure which one is correct, click the "open in Visual Studio Code" button, and it will show you the differences, letting you pick.

byake
  • 321
  • 4
  • 15
  • is there a way to tell which one my working copy is? – ShedSports Sep 08 '20 at 23:47
  • You are the only person that knows that really, but in general, yes you should be able to tell. If it is "working" locally before the merge, then that may be the one you want. If you broke something and want to go back to how it was before, maybe the remote has the correct version. If someone else pushed to the remote while you were working locally, then you need to figure out which changes to keep or how to merge them. – byake Sep 08 '20 at 23:51
  • I have the working one locally, that's what I want to push. But I dont know whether it is ```master``` or ```origin/master``` – ShedSports Sep 09 '20 at 00:02
  • `origin/master` is the copy of the master branch that has been fetched from `origin` which is a remote repository. your local master branch is simply called `master`. you can verify this at the command line with `git remote -v` and `git branch -a`. – byake Sep 09 '20 at 00:07