My teammate has pushed some code changes on the git repo but when I use the command git log, I cannot see his commit in the commit history. I can view it only when I pull the code. Is there a way to see all the commits made by everyone without pulling the code using git pull.
3 Answers
The original poster asks:
Is there a way to see all the commits made by everyone without pulling the code using git pull.
The answer is no. In order to see a log of the newest changes on the remote repository, you must fetch or pull those changes first:
git fetch origin git log origin/master Or
git checkout master git pull origin master git log origin/master Comments
You need to check the log on the remote repository instead of your local using git log remote remotename/branchname. For example:
git log remote origin/master To see what commits have been added to the upstream , you can run a git log using branch with the following commands:
git log origin/<branch> More info: https://www.atlassian.com/git/tutorial/remote-repositories#!fetch