Why does Git say my master branch is “already up to date” even though it is not?

前端 未结 7 1506
甜味超标
甜味超标 2021-01-29 17:17

Basic Problem

I just deleted ALL the code from a file in my project and committed the change to my local git (on purpose). I did

git pull upstream mas         


        
7条回答
  •  清歌不尽
    2021-01-29 17:55

    I had the same problem as you.

    I did git status git fetch git pull, but my branch was still behind to origin. I had folders and files pushed to remote and I saw the files on the web, but on my local they were missing.

    Finally, these commands updated all the files and folders on my local:

    git fetch --all
    git reset --hard origin/master 
    

    or if you want a branch

    git checkout your_branch_name_here
    git reset --hard origin/your_branch_name_here
    

提交回复
热议问题