Find Git Branching Point Between Branch

sunday-snippet · Jun 5, 2022 · ~1 min
Sunday Snippet #20 find git branching point between branch
Sunday Snippet #20 find git branching point between branch
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
➜  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
· · ·

Love This Content?

Any kind of supports is greatly appreciated! Kindly support me via Bitcoin, Ko-fi, Trakteer, or just continue to read another content. You can write a response via Webmention and let me know the URL via Telegraph.

Drop Your Comment Below