2

I have a git repository in my local and also in github. I have also a collaborator(my partner) in that github repository. I have added some new file in my local and push those in the remote by git push origin master and the updates are shown in github repo.

Now, my partner try to know whether any update in remote using git fetch but results nothing although the remote is updated with new files.

What is the exact command to know this and add those in local?

2 Answers2

1

Make sure the git fetch is done from a local repo which has the same remote URL as your GitHub repo:

cd /path/to/local/repo
git remote -v

Then check which branch has actually been updated with:

git branch -avv

You will see the remote branches

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • git branch -avv shows `$ git branch -avv\\ * master 02ce9f9 [origin/master: behind 1] update DDL.sql\\ remotes/origin/HEAD -> origin/master remotes/origin/master 15f4296 add Image directory` –  Mar 30 '18 at 04:56
  • @moon Then a git pull will update master (it will fetch and merge) – VonC Mar 30 '18 at 04:58
  • @moon Yes, because your local master is tracking origin/master. – VonC Mar 30 '18 at 05:02
0

As mentioned in this question accepted answer:

  1. git remote update to update your refs
  2. git status -uno will give the status of the branch you are tracking
dstrants
  • 7,423
  • 2
  • 19
  • 27