DEV Community

Clavin June
Clavin June

Posted on • Originally published at clavinjune.dev on

2 2

Find Git Branching Point Between Branch

Sunday Snippet #20 find git branching point between branch

➜  pet git:(master) git --no-pager log --oneline -1
2422e70 (HEAD -> master, origin/master) update README.md
➜  pet git:(master) git checkout -b testing
Switched to a new branch 'testing'
➜  pet git:(testing) git commit --allow-empty -sam "first"
[testing 8210c2d] first
➜  pet git:(testing) git commit --allow-empty -sam "second"
[testing feb9b4f] second
➜  pet git:(testing) git commit --allow-empty -sam "third"
[testing 7120047] third
➜  pet git:(testing) git --no-pager log --oneline -4
7120047 (HEAD -> testing) third
feb9b4f second
8210c2d first
2422e70 (origin/master, master) update README.md
# how to get this branching point (2422e70) from `testing` branch?
# git rev-list --boundary branch1...branch2 | grep "^-" | cut -c2-
➜  pet git:(testing) git rev-list --boundary testing...master  | grep "^-" | cut -c2-
2422e70001b80d186fdd1df1a9227dc3d8e0061e
Enter fullscreen mode Exit fullscreen mode

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay