mirror of
https://github.com/git-tips/tips
synced 2024-11-10 05:44:14 +00:00
Merge pull request #169 from mcsnolte/simplify-common-ancestor
Change to the simpler merge-base command
This commit is contained in:
commit
dfdfac36e0
2 changed files with 2 additions and 2 deletions
|
@ -1080,7 +1080,7 @@ git fetch origin master:refs/remotes/origin/mymaster
|
|||
|
||||
## Find common ancestor of two branches
|
||||
```sh
|
||||
diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1
|
||||
git merge-base <branch-name> <other-branch-name>
|
||||
```
|
||||
|
||||
## List unpushed git commits
|
||||
|
|
|
@ -445,7 +445,7 @@
|
|||
"tip": "git fetch origin master:refs/remotes/origin/mymaster"
|
||||
}, {
|
||||
"title": "Find common ancestor of two branches",
|
||||
"tip": "diff -u <(git rev-list --first-parent BranchA) <(git rev-list --first-parent BranchB) | sed -ne 's/^ //p' | head -1"
|
||||
"tip": "git merge-base <branch-name> <other-branch-name>"
|
||||
}, {
|
||||
"title": "List unpushed git commits",
|
||||
"tip": "git log --branches --not --remotes",
|
||||
|
|
Loading…
Reference in a new issue