1

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.

1

3 Answers 3

1

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 
Sign up to request clarification or add additional context in comments.

Comments

1

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 

1 Comment

git log remote isn't an actual git command. There is a git log --remotes flag, but that won't make a network operation to find out if the remote has new commits. You still need to fetch or pull first.
1

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

1 Comment

The original poster is asking if there is a way to view new commits on a remote without having to fetch or pull. Your answer still requires a fetch or pull if there are new commits, so it doesn't really solve the problem.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.