sarah w
sarah w

Reputation: 3475

Why doesn't "git status" show that the remote branch has changed?

I have created a branch fea-test and pushed to the remote repository. Then, I added some files in the same remote branch fea-test, but when I do git status, it says

Your branch is up to date with 'origin/fea-test'.

nothing to commit, working tree clean

According to me, it should display something like

Your branch is behind  with 'origin/fea-test'.
    
    use git pull to get the changes 

because this is how it happens in GitLab (and now I'm using GitHub). What am I doing wrong here?

Upvotes: 2

Views: 2639

Answers (1)

bimlas
bimlas

Reputation: 2587

To be clear, check that these the steps you did:

  • Create a branch on local machine
  • Push to remote (GitHub)
  • On GitHub, you added a new file via Create new file button
  • You called git status on local machine and expected the newly created files / commits to be listed.

If I'm right, then you have to git fetch the changes from GitHub (so Your branch is behind of 'origin/fea-test' by XY commits will be shown in status) or use git pull to fetch + merge those (so your local branch will be updated).

Be sure that you know Git!

Upvotes: 3

Related Questions