Posts

Showing posts with the label after splitted

How to list only commits which was made after branch was splitted(checkouted)

To list only the commits made on your current branch after it split from a parent branch, use the double-dot ( .. ) syntax with git log . 💻 The Best Commands Run this command from your current branch:  git log main..HEAD If you prefer a clean, single-line overview:   git log --oneline main..HEAD (Note: Replace main with master , develop , or whatever the name of your parent branch is.) 🔍 How It Works The .. operator acts as a set subtraction tool.  main..HEAD means: "Show me all commits reachable from HEAD (your current branch), but exclude any commits that are reachable from main ." This leaves you exactly with the new commits added to your feature branch since the day you used git checkout -b .   💡 Advanced Options Depending on your workflow, you can add flags to handle specific scenarios: Exclude Merge Commits: If you have pulled or merged other branches into your feature branch and only want to see your unique work, add --no-merges : git log main..HEAD...