-1

I was updating my fork of a project on git by doing the normal methods i.e

git fetch upstream
git rebase upstream/master

All works fine, I get the most recent updates of the original repo, but when I go to sync it, GitHub(I use the windows client) says that there are merge conflicts, and it appears that some random text has been inserted into the code.

Here is a screenshot to the problem: http://puu.sh/7J8NE.png

This issue pops up randomly time to time, but usually discarding the changes and then syncing seems to work, however this time it didn't, and I'm a bit stumped.

Any help is appreciated.

Hav3n
  • 251
  • 5
  • 21
  • `rebase` is everything, but _not_ a "normal" method for updating. – Andreas Wiese Mar 25 '14 at 20:14
  • That depends. When contributing changes back to the main project, rebasing a private topic branch to the current `master` avoids unnecessary merge commits in the main history. – user3426575 Mar 25 '14 at 20:56

2 Answers2

2

That's not random text, those are merge annotations.

When you have merge conflicts you have to merge the conflicting files, commit and then you will see that the annotations will be gone.

See Merge conflict resolution for more information.

Community
  • 1
  • 1
Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235
0

It seems someone else pushed to the repository in the meantime, so the current upstream branch isn't a parent of your branch any more. Just repeat your procedure

git fetch upstream
git rebase upstream/master

and you should be fine.

user3426575
  • 1,723
  • 12
  • 18