简体   繁体   中英

Can only pull once from remote git repository

can somebody tell me why I can only pull one time from the remote in git. For the second time it fails and I am getting the message, Already up to date.

I am experimenting. Both the remote and the local repo have the file test.txt, but with different content. the first time I pull using

git pull heroku master

it worked, and i chose not to accept the incoming change and keep my local file the same. theoretically, I should be able to pull again, however the second time it fails with the message "Already up to date".

Is it because of the Fetch_Head that is pointing to the same content? I tried to reset Fetch_Head with reset --hard Fetch_Head, however I still cannot pull from the remote.

Pull is fetch + merge: the fetch part is already completed.

Check your git status : if HEAD is at master and heroku/master , there is nothing more to pull.

If you want your content to reflect heroku/master, try the new git restore command (Git 2.23+):

git restore -s heroku/master -SW -- .

This assumes you don't have any work in progress, as it is akin to a git reset --hard .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM