Questions tagged [git-log]

Shows the commit logs of a Git repo

git log shows the commit logs in Git repository.

You can view the commit history of a specific file with the following:

git log <filename>

git log provides a large number of options to filter and format the resulting output, see the documentation for full details.

Reference

$ git log --help
920 questions
3789
votes
27 answers

View the change history of a file using Git versioning

How do I view the history of an individual file with complete details of what has changed? git log -- [filename] shows me the commit history of a file, but how do I see the file content that changed?
Richard
  • 39,052
  • 6
  • 25
  • 29
2258
votes
27 answers

How to list unpushed Git commits (local but not on origin)

How can I view any local commits I've made, that haven't yet been pushed to the remote repository? Occasionally, git status will print out that my branch is X commits ahead of origin/master, but not always. Is this a bug with my install of Git, or…
Josh Buhler
  • 26,878
  • 9
  • 29
  • 45
1851
votes
37 answers

Pretty Git branch graphs

I've seen some books and articles have some really pretty looking graphs of Git branches and commits. How can I make high-quality printable images of Git history?
krosenvold
  • 75,535
  • 32
  • 152
  • 208
1602
votes
16 answers

How can I view a git log of just one user's commits?

When using git log, how can I filter by user so that I see only commits from that user?
markdorison
  • 139,374
  • 27
  • 55
  • 71
1278
votes
7 answers

How to exit git log or git diff

I'm trying to learn Git with the help of Git Immersion. There's one thing that frustrates me whenever I use git log or git diff: I can't figure out what to do next when I encounter this (END) word. I can't type any commands, and I end up closing…
Wern Ancheta
  • 22,397
  • 38
  • 100
  • 139
1197
votes
13 answers

How to search a Git repository by commit message?

I checked some source code into GIT with the commit message "Build 0051". However, I can't seem to find that source code any more - how do I extract this source from the GIT repository, using the command line? Update Checked in versions 0043, 0044,…
Contango
  • 76,540
  • 58
  • 260
  • 305
822
votes
9 answers

How to grep commits based on a certain string?

In a Git code repository I want to list all commits that contain a certain word. I tried this git log -p | grep --context=4 "word" but it does not necessarily give me back the filename (unless it's less that five lines away from the word I searched…
Jesper Rønn-Jensen
  • 106,591
  • 44
  • 118
  • 155
587
votes
5 answers

What are the differences between double-dot ".." and triple-dot "..." in Git commit ranges?

Some Git commands take commit ranges and one valid syntax is to separate two commit names with two dots .., and another syntax uses three dots .... What are the differences between the two?
Pat Notz
  • 208,672
  • 30
  • 90
  • 92
567
votes
10 answers

How do I run git log to see changes only for a specific branch?

I have a local branch tracking the remote/master branch. After running git-pull and git-log, the log will show all commits in the remote tracking branch as well as the current branch. However, because there were so many changes made to the remote…
Highway of Life
  • 22,803
  • 16
  • 52
  • 80
493
votes
11 answers

How do I see the commit differences between branches in git?

I'm on branch-X and have added a couple more commits on top of it. I want to see all the differences between MASTER and the branch that I am on in terms of commits. I could just do a git checkout master git log and then a git checkout…
Son of the Wai-Pan
  • 12,371
  • 16
  • 46
  • 55
309
votes
4 answers

How to find the commit in which a given file was added?

Say I have a file foo.js that was committed some time ago. I would like to simply find the commit where this file was first added. After reading the answers and my own tinkering, this works for me git log --follow --diff-filter=A --find-renames=40%…
Zombo
  • 1
  • 62
  • 391
  • 407
277
votes
11 answers

Commit history on remote repository

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.
user1795998
  • 4,937
  • 7
  • 23
  • 23
262
votes
12 answers

Get a list of all Git commits, including the 'lost' ones

Let's say that I have a graph like this: A---B---C---D (master) \ \-E---F (HEAD) If I do git log --all --oneline, I will get all six of my commits. But if the graph is: A---B---C---D (master, HEAD) \ \-E---F I will not see E…
Amadan
  • 191,408
  • 23
  • 240
  • 301
253
votes
5 answers

How do I view all commits for a specific day?

I've already looked at the relevant docs from git-scm.com and gitref.org, but I can't seem to figure this out. Let's say I want to get all commits for Tuesday, November 12th, 2013. Using an existing repo as an example, I know for a fact that I have…
3cheesewheel
  • 9,133
  • 9
  • 39
  • 59
244
votes
7 answers

How to git log in reverse order?

I recently learned that I can get hg log to print the history in reverse order with: hg log -r : So of course I tried: git log -r : Well, it didn't work. So what is the command to do the same thing in git?
Erik B
  • 40,889
  • 25
  • 119
  • 135
1
2 3
61 62