Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I visualise my git repo properly?

I'm currently making commits and using branches in my remote Git repo. But, whenever I use:

git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative

It just shows my commit history in a single line - no branches, despite branches being named 'origin/API', 'origin/dev' and 'origin/master'.

A screenshot of my terminal output

If you have a look at Showing Git branch structure (where I got the command from) the screenshot shows 'branches' and 'merges'

Can you guys help me? I wish to view my repo in a tree fashion (helps me visualise better) rather than a beanstalk...

like image 276
thisispiers Avatar asked Mar 24 '23 11:03

thisispiers


1 Answers

Try this one to view a graph of your repo over time.

git log --oneline --graph --all --decorate

Note that the decorate will show you where the heads of the various merged in branches are. And oneline gets it all on one line so that it is easy to navigate.

like image 55
usumoio Avatar answered Apr 01 '23 05:04

usumoio