Git push won't do anything (everything up-to-date)

后端 未结 16 2342
轻奢々
轻奢々 2020-12-04 05:38

I\'m trying to update a Git repository on GitHub. I made a bunch of changes, added them, committed then attempted to do a git push. The response tells me that e

16条回答
  •  半阙折子戏
    2020-12-04 06:27

    Instead, you could try the following. You don't have to go to master; you can directly force push the changes from your branch itself.

    As explained above, when you do a rebase, you are changing the history on your branch. As a result, if you try to do a normal git push after a rebase, Git will reject it because there isn't a direct path from the commit on the server to the commit on your branch. Instead, you'll need to use the -f or --force flag to tell Git that yes, you really know what you're doing. When doing force pushes, it is highly recommended that you set your push.default config setting to simple, which is the default in Git 2.0. To make sure that your configuration is correct, run:

    $ git config --global push.default simple
    

    Once it's correct, you can just run:

    $ git push -f
    

    And check your pull request. It should be updated!

    Go to bottom of How to Rebase a Pull Request for more details.

提交回复
热议问题