From c333d5516f0cc47d2bd130cfcdf5edd4dfaea27c Mon Sep 17 00:00:00 2001 From: Steve Nolte Date: Fri, 18 Jan 2019 10:34:23 -0600 Subject: [PATCH] Change to the simpler merge-base command Good to showcase this command as it also provides additional features like --fork-point and --all. --- README.md | 2 +- tips.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 214852e..688d835 100644 --- a/README.md +++ b/README.md @@ -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 ``` ## List unpushed git commits diff --git a/tips.json b/tips.json index ea1ee54..4ecadbe 100644 --- a/tips.json +++ b/tips.json @@ -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 " }, { "title": "List unpushed git commits", "tip": "git log --branches --not --remotes",