Git: is there a quick way to see when the last git merge wizard was executed in the current working branch?

I usually work on a branch that diverges from the master. So while I develop things, I do git merge master from time to time. And sometimes I want to know when was the last time, I did git merge master on this branch. I know I can do git log and look for "Merge branch" and see the commit date ... but if there is magic, I would like to know!

+7
source share
3 answers
 git show :/"Merge branch 'master'" 
+8
source

I personally like to check the difference in the revision trees:

 git log --graph --left-right --cherry-pick --oneline branch1...branch2 

In addition, in the "magic" department there is

 git show-branch git show-branch branch1 branch2 git show-branch --all # which does all of the above and more 

And finally

 git merge-base branch1 branch2 

to name the base version to be combined with


Notes:

 --cherry-pick 

Omit any commit that introduces the same change as another commit on the โ€œother sideโ€ when the set of commits is limited to a symmetric difference.

For example, if you have two branches, A and B, the usual way to list all commits is only on one side - with -left-right, as in the example above in the description of this parameter. However, it shows the fixations that were selected from another branch (for example, โ€œ3rd on bโ€ can be selected from cherry from branch A). With this option, such commit pairs are excluded from the output.

+3
source

You can use git merge-base to get a common ancestor and display the results.

Something like that:

git merge-base HEAD master | git show --pretty

+1
source

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


All Articles