git log filter merge commits 1

git log filter merge commits

git log --no-merges

Here is what the above code is Doing:
1. git log –no-merges: This command will list all the commits in the current branch.
2. | grep -E “^commit”: This command will filter out all the lines that don’t start with “commit”.
3. | awk ‘{print $2}’: This command will print the second column of the output.
4. | head -n 1: This command will print the first line of the output.

Similar Posts