1

I want to list down last commits which were made in different branches together. ie. I want to see the branch name, even if I've forgotten in some cases.

Scenario => Let's take - I was working in 3 different branches in a single day & I wanted to see what last commits I have made in all those 3 branches together ie. - Not by mentioning any branch name.

I can get all commits pushed in a particular branch with this command -

git log mybranchName

Is there any provision which can give me result like -

Branch login => commit: Added form design.

Branch register => commit: Registration module completed.

Branch master => commit: Release v1.0.0

Note - Not just 3 branches, It should be a flag to get how many of the last branches I wanted to list down. The only purpose is to list down the branches in which I am working on without jotting down it.

Also happy if any flag can help me to achieve this.

Anuj Raghuvanshi
  • 664
  • 1
  • 7
  • 24

2 Answers2

1

You might want to give a look at this question.

One good command to see all branches at the same time in a nice way is the following:

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

To remember it, see this answer.

Anuj Raghuvanshi
  • 664
  • 1
  • 7
  • 24
Enlico
  • 23,259
  • 6
  • 48
  • 102
1

If you are using simple graphical interface like gitk or gitg you can pass --all option and it will list all branches with commits:

ROOT
  • 11,363
  • 5
  • 30
  • 45