Do a Git pull to overwrite local changes

前端 未结 2 1099
[愿得一人]
[愿得一人] 2021-01-31 12:26

There has certainly been posts around for this, but I actually did a commit because I thought it was the right thing to do.

So, I have two repositories, one development

2条回答
  •  情深已故
    2021-01-31 12:59

    If you want to entirely replace your local branch foo with the contents of the remote branch origin/foo:

    git fetch origin
    git checkout foo
    git reset --hard origin/foo
    

    If you want to do something else, please reword your question. However, I might add the production Git repository as a remote and then merge the live changes in, instead of whatever you tried.

提交回复
热议问题