0

I have a forked repo that I forked a few months ago.

I follow this answer to update my repo, when I do git rebase upstream/master, I get a conflict (but I never touch my master branch before, maybe the upstream repo has used force push?)

After resolved the conflict, another conflict comes.. I don't want to resolve all of them by hands, I just want to replace my master branch to sync with the upstream one, is there anything like force rebase?

Community
  • 1
  • 1
CodinCat
  • 15,530
  • 5
  • 49
  • 60
  • `another conflict comes` ... this is how rebasing works. If you don't want to rebase, you can try merging instead, e.g. `git merge upstream/master` – Tim Biegeleisen Jan 19 '17 at 03:07
  • @TimBiegeleisen I tried `git merge`, and got tons of conflicts. Also wouldn't `git merge` generate a merge commit? – CodinCat Jan 19 '17 at 03:11
  • If you don't want a merge commit, then rebasing is probably your only option. But there is no avoiding conflicts between the two branches, conflicts which appear in rebase would also appear using merge, though possibly in a different way. – Tim Biegeleisen Jan 19 '17 at 03:13

1 Answers1

3

Ok I make it works.

After fetch the upstream, just reset to the upstream/master

git reset --hard upstream/master
CodinCat
  • 15,530
  • 5
  • 49
  • 60