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
104
votes
3 answers

git log show one commit id only

I need some help. It is possible to only show one commit id? Since git log -3 show the log from 1 - 3, I just want to show only 3. What possible command will match for it? I use the command git log -3 --pretty=format:"%h" the result…
rkevx21
  • 2,441
  • 5
  • 19
  • 40
102
votes
7 answers

show commits since branch creation

Is there a way to see with git log or some other command only the commits that were added after branch creation? usage: git log [] [..] [[--] ...] or: git show [options] ... --quiet suppress…
lurscher
  • 25,930
  • 29
  • 122
  • 185
102
votes
3 answers

Git show all branches (but not stashes) in log

I have a Git alias that expands to: git log --graph --oneline --all --decorate According to man git log there are a couple of suspicious options: --not and --branches; but I can't make it work properly. How should I edit that to hide the…
cYrus
  • 2,976
  • 6
  • 29
  • 47
97
votes
6 answers

Move file and directory into a sub-directory along with commit history

How can I move a directory and files to a sub-directory along with commit history? For example: Source directory structure: [project]/x/[files & sub-dirs] Target directory structure: [project]/x/p/q/[files & sub-dirs]
rst.ptl
  • 971
  • 1
  • 6
  • 5
92
votes
1 answer

Why doesn't "git log -‌- foo" work for deleted file foo?

My repository underwent changes such as: ...some unrelated commits... Commit new file foo with 100 lines of content ...intervening commits, some of which touch foo... Insert the contents of foo at the top of an existing file bar and git rm foo in…
user385804
  • 921
  • 1
  • 6
  • 4
87
votes
6 answers

How to make Git log show all of today's commits?

I want to be able to see all of the commits I made today using git log. I came up with git log --after="yesterday" However, that seems a little awkward to me, is there a simpler command to achieve the same effect?
ab217
  • 16,900
  • 25
  • 74
  • 92
81
votes
5 answers

Git show files that were changed in the last 2 days

How can I have a list with all the files that were changed in the last 2 days? I know about git log --name-status --since="2 days ago" but this will show me ids, dates and commit messages. All I need is the list of the file names which were…
dole doug
  • 34,070
  • 20
  • 68
  • 87
79
votes
5 answers

Can Git track the movement of a single function from 1 file to another? How?

Several times, I have come across the statement that, if you move a single function from one file to another file, Git can track it. For example, this entry says, "Linus says that if you move a function from one file to another, Git will tell you…
Charlie Flowers
  • 17,338
  • 10
  • 71
  • 88
72
votes
13 answers

Broken branch in git, fatal: your current branch appears to be broken

Here is my case: I was working on one branch. Pushed new commits to the remote. Switched back to the master branch. But suddenly after typing git checkout master command my computer encountered blue screen of death and an unexpected force shut…
Suresh Karia
  • 17,550
  • 18
  • 67
  • 85
72
votes
8 answers

Show all stashes in git log

I would like to see all stashes in git log output. Does anyone know if there is a way to do that? Edit: I want to see all commits in the log -- including stash commits. I tried the command: git log --date-order --all But it returns only the top…
jbialobr
  • 1,382
  • 1
  • 13
  • 14
70
votes
5 answers

How do I show just the names and commit titles since a tag in Git?

I'm trying to use tags for release management in Git—I create a tag for each release. I'd like to be able to create release notes by listing the comment titles for every commit since a tag, or between 2 tags. I can't seem to find any way to do this.
Christopher Pickslay
  • 17,523
  • 6
  • 79
  • 92
70
votes
1 answer

How to `git log` a tree-ish from another branch?

Let's say I have a Git repo with branch A and branch B. Branch B is currently checked out (i.e. .git/HEAD contains refs/heads/B). Now, without checking out branch A, how to view the history (log) of path/file in branch A? Following git help…
ulidtko
  • 14,740
  • 10
  • 56
  • 88
69
votes
3 answers

How to see commits that were merged in to a merge commit?

If my-feature-branch was merged into my-main-branch, how can I see what commits were merged in from my-feature-branch?
The Pixel Developer
  • 13,282
  • 10
  • 43
  • 60
67
votes
2 answers

git log the difference between 1 branch from another

I have 2 branches A and B. Whenever I run a build, Branch A gets merged into Branch B. I want to be able to email out all the updates made in A, since the last time the build was ran. How can I use git log to be able to copy all the commits made in…
Adam Johnson
  • 2,198
  • 1
  • 17
  • 23
64
votes
4 answers

How can I make git log order based on author's timestamp?

I use a fairly complex git-log command involving --date-order to get an overview of my repository's status; but unfortunately, --date-order seems to use the committer date, not the author date. That means that each time I bring my topic branches up…
ELLIOTTCABLE
  • 17,185
  • 12
  • 62
  • 78
1 2
3
61 62