Git Log Views
Short & pretty with a graph
Published in
1 min readJun 27, 2019
My favorite:
git log --pretty=format:"%h %s %an" --graph -14
%h
hash abbreviated
%s
subject
%an
author name
-14
limits the output to only show the last 14 commits.
Example output:
* 5b26b0b Merge branch 'master' of https://github.com/deepcelllineage/mitolin
|\
| * 937d24f edit folder structure, mitolin now has: gen, nb, src, and one example fastq (1eg33MBfastq)
| * 2e8ec82 renamed lab_notebook/ directory to nb/
| * 834be28 create nb directory for lab notebooks, add nb entry re farm on hpc, start vcf2fasta_v0.0.1.sh
| * cda3eee Merge remote-tracking branch 'origin/master'
| |\
| * | ff43d91 some phylogenomic papers added
* | | 2849ed3 renamed lab_notebook/ directory to nb/
* | | 269ba03 create nb directory for lab notebooks, add nb entry re farm on hpc, start vcf2fasta_v0.0.1.sh
| |/
|/|
* | 04a65f7 Merge remote-tracking branch 'refs/remotes/origin/master'
|\ \
| |/
| * 83fc4a1 change folder hierarchy
| * c663a78 Merge pull request #2 from mkeisenbach/mismatched
| |\
| | * 52b98a6 feat: add Python notebook and output files for mismatched filenames
| |/
* | 930adc2 add 'data/' to .gitignore
|/
* 4f7ecfc added 1 raw fastq file into nguyen_nc_2018/ind1 and r1 r2 lists to generated/
Make an alias
After I memorize this, I should make an alias for it.
alias gl='git log --pretty=format:"%h %s" --graph'
and put it into my .bash_profile
echo 'n/ alias gl='git log --pretty=format:"%h %s" --graph' >> ~/.bash_profile
Read more here:
https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History