-1

I am new to GIT. I have a repository on git hub.com. I committed a new file to github repository. When I check the last commit changes using log command it shows only the commits on my local repository. But my github repository is a collaborative repository. The question is that I have to check recent commits if others commits a file. Thanks.

gturri
  • 13,807
  • 9
  • 40
  • 57
  • 1
    possible duplicate of [Commit history on remote repository](http://stackoverflow.com/questions/13941976/commit-history-on-remote-repository) – Andy Mar 21 '15 at 05:30

1 Answers1

0

Once you fetch the remote repository, you have all the commits in your local repo. You also have the branches of the remote repo: they're just prefixed with origin/ (if your remote is called origin). You can list them with git branch -r

So you can do something like this:

git fetch origin
N=3 #say you want to see the last 3 commits of each remote branches
for REMOTE_BRANCH in $(git branch -r | grep origin); do
  echo "Showing branch $REMOTE_BRANCH"
  git log -$N $REMOTE_BRANCH
done

That is if you want to stick to command line. Otherwise it might be easier to use gitk:

sudo apt-get install gitk #Or any other way to install it depending on your platform
git fetch
gitk --all # flag --all implies "show every branches"
gturri
  • 13,807
  • 9
  • 40
  • 57