Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

See any Git commits directly to master?

Let's say a dev team is supposed to commit all their changes to local branches, finish the feature inside the branch, followed by merging the branch into master.

How exactly can one find out if there were any commits made directly to master?

like image 791
RandomAndy Avatar asked Oct 26 '25 12:10

RandomAndy


1 Answers

This will walk back the commit history of the branch master, taking the first/left parent of any merge commits (thus ignoring commits brought in by merges), and displays only those commits that are not merges:

git log master --first-parent --no-merges
like image 119
TuukkaH Avatar answered Oct 28 '25 04:10

TuukkaH