Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    This solution does not work when you have a protected branch because those branches do not allow to do --force to overwrite history. Commented Jun 10, 2021 at 12:33
  • @RobinBastiaan Then you're stuck with the complicated solution. See other answers to this question. Commented Jun 15, 2021 at 18:17
  • Can I use this to bring a branch completely into line with 'master' itself? Commented Mar 7, 2022 at 15:13
  • 2
    @JamesBB Yes, git reset origin/master --hard will make the branch exactly the same as remote master. Commented Mar 7, 2022 at 17:59