How do I render my git repository correctly?

I am currently committing and using branches in a remote Git repository. But, when 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 on one line - no branches, even though the branches are called "origin / API", "origin / dev" and "origin / master".

A screenshot of my terminal output

If you look at Git branch structure mapping (where I got the command from), the screenshot shows the "branches" and "merges"

Can you guys help me? I want to view my repo in a tree structure (helps me visualize better), not beanstalk ...

+4
source share
3 answers

From the original poster:

If you look at Git branch structure mapping (where I got the command from), the screenshot shows the "branches" and "merges"

screenshot of other log output with merge commits

If you want to see diverging branches in the log output, you must have a merge commit. In fact, you have not done any unrealizable merges (which will lead to merge commands), so you see, indeed, all your branches with the master parent thread dev and dev parent thread API .

original poster's log output

You will begin to view merge commits if you merge without quickly moving the API to the dev branch, for example:

 # From the dev branch $ git merge --no-ff API $ git log --oneline --graph --decorate * 419eadf (HEAD, dev, API) |\ | * 1b6ebed where API used to be |/ * 51464fc where dev used to be | * asdfhsdf (master) 
+2
source

Try this to view your repo chart over time.

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

Note that decorate will show you where the chapters of the various associations in the branches are located. And oneline gets everything on one line, so it's easy to move.

+4
source

You can try the command below. It worked for me.

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

+1
source

Source: https://habr.com/ru/post/1491461/


All Articles