git pull says “Already up to date” after undoing a git pull

人走茶凉 提交于 2019-12-07 08:30:30

问题


I've just installed a new extension in magento, committed and pushed. It's on a staging branch of github. I've pulled it on my staging server using

git pull origin staging

and it just broke my website. I need to revert it back. I did

git push -f origin HEAD^:staging
git reset --hard HEAD^
git push origin staging

this removed the extension from my branch. But now when I pull this branch on server using

git pull origin staging

It says "Already up to date".

How to remove this extension from the server now ??


回答1:


If I understood correctly your problem, you have three repos

  1. A remote on GitHub
  2. A local for development
  3. A local on your staging server

You have first update all the repos, then rewritten the history on the remote and on the development and tried to pull on the staging. Unfortunately, the staging already had already its own history, so try the following on staging:

git fetch
git reset --hard origin/staging

This will force the history on staging to be rewritten as well.



来源:https://stackoverflow.com/questions/19854332/git-pull-says-already-up-to-date-after-undoing-a-git-pull

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!