How to Use the Git Log Graph Command by Example

preview_player
Показать описание
Properly visualize your commit history with these git log graph examples. Here we'll show you the basics of how the git log graph command works, but also some hints on how to get the most out of your log graph by adding in oneline and other pretty options such as using a custom string.
Рекомендации по теме
Комментарии
Автор

One command I didn't include was "a dog." git log --all --decorate --oneline --graph. It's described in detail in this git log graph article on TheServerSide:

cameronmcnz
Автор

1:06 git log --oneline
1:11
2:06 git log --graph --oneline
3:05 git log --pretty
3:15 git log --pretty=short
3:33 *custom command*

ruixue
Автор

I found in some git log graphs I was doing I was seeing remote branches that had been rebased. To get rid of remote branches just add the --branch switch instead of --all
git log --oneline --graph --branches master develop

cameronmcnz
Автор

First! What a coincidence, needed a quick reference about this and I see you just uploaded one. Thanks!

melvyniandrag
Автор

To only show to branches, just name them at the end: git log --oneline --graph master develop
This will show only the master and develop branches, even if you have an entire gitflow thing happening.

cameronmcnz
Автор

That's cool. Is there a source that lists all the options for the custom command? For example, how do I know that %h stands for the hash and %s for the commit message? What other options are there?

SaschaFroelich
Автор

How do you view all commits from a specific branch?

justingiovanetti