Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Commit history on remote repository

Tags:

git

git-log

I am trying to access a branch's commit history on a remote repository. I had a look at the doc but could not find any substantial information on how to access a remote repo's commit history using my local git client.

like image 294
user1795998 Avatar asked Dec 18 '12 21:12

user1795998


People also ask

How do I see commit history in repository?

On GitHub, you can see the commit history of a repository by: Navigating directly to the commits page of a repository. Clicking on a file, then clicking History, to get to the commit history for a specific file.

What is the command to get all the change history of the remote repository?

The git fetch command downloads commits, files, and refs from a remote repository into your local repo. Fetching is what you do when you want to see what everybody else has been working on.

How do I pull a commit from a remote?

The short answer is: you cannot pull a specific commit from a remote. However, you may fetch new data from the remote and then use git-checkout COMMIT_ID to view the code at the COMMIT_ID .


1 Answers

git log remotename/branchname 

Will display the log of a given remote branch in that repository, but only the logs that you have "fetched" from their repository to your personal "copy" of the remote repository.

Remember that your clone of the repository will update its state of any remote branches only by doing git fetch. You can't connect directly to the server to check the log there, what you do is download the state of the server with git fetch and then locally see the log of the remote branches.

Perhaps another useful command could be:

git log HEAD..remote/branch 

which will show you the commits that are in the remote branch, but not in your current branch (HEAD).

like image 78
Maic López Sáenz Avatar answered Oct 17 '22 22:10

Maic López Sáenz