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

前端 未结 7 1503
甜味超标
甜味超标 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

    Just a friendly reminder if you have files locally that aren't in github and yet your git status says

    Your branch is up to date with 'origin/master'. nothing to commit, working tree clean

    It can happen if the files are in .gitignore

    Try running

    cat .gitignore 
    

    and seeing if these files show up there. That would explain why git doesn't want to move them to the remote.

提交回复
热议问题