Why does Git say my master branch is “already up t

2020-05-10 20:46发布

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 master

to fetch and merge from upstream (so in theory that deleted code should be back).

Git tells me everything is up to date.

Everything is definitely NOT up to date -- all that deleted code is still deleted.

Other Relevant Info

I only have one branch called "master".

I recently set up "master" to track upstream like so:

Branch master set up to track remote branch master from upstream.

The command git branch -vv yields:

* master 7cfcb29 [upstream/master: ahead 9] deletion test

Why why why is this happening? I'm on the verge of just e-mailing my project manager any changes I make to our code.

Update

I thought it was obvious, but anyways this is my goal:

Get the most recent of the code on my system.

Excuse my anger here, but why does such a simple task as that have to be so hard?

标签: git github merge
7条回答
smile是对你的礼貌
2楼-- · 2020-05-10 21:40

While none of these answers worked for me, I was able to fix the issue using the following command.

git fetch origin

This did a trick for me.

查看更多
登录 后发表回答