From dbad3a6995345e035bc15e3adbdc4eba523593e6 Mon Sep 17 00:00:00 2001 From: Isabelle Viktoria Maciohsek Date: Mon, 5 Apr 2021 09:47:59 +0300 Subject: [PATCH] Add branches contain/not contain commit --- snippets/branches-containing-commit.md | 18 ++++++++++++++++++ snippets/branches-not-containing-commit.md | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 snippets/branches-containing-commit.md create mode 100644 snippets/branches-not-containing-commit.md diff --git a/snippets/branches-containing-commit.md b/snippets/branches-containing-commit.md new file mode 100644 index 000000000..58c4ce6ba --- /dev/null +++ b/snippets/branches-containing-commit.md @@ -0,0 +1,18 @@ +--- +title: Find branches containing a commit +tags: branch,commit,beginner +--- + +Prints all the branches containing a specific commit. + +- Use `git branch --contains ` to see a list of all branches containing ``. + +```sh +git branch --contains +``` + +```sh +git branch --contains 3050fc0d3 +# patch-1 +# patch-2 +``` diff --git a/snippets/branches-not-containing-commit.md b/snippets/branches-not-containing-commit.md new file mode 100644 index 000000000..e6cffc3e1 --- /dev/null +++ b/snippets/branches-not-containing-commit.md @@ -0,0 +1,18 @@ +--- +title: Find branches not containing a commit +tags: branch,commit,beginner +--- + +Prints all the branches not containing a specific commit. + +- Use `git branch --no-contains ` to see a list of all branches not containing ``. + +```sh +git branch --no-contains +``` + +```sh +git branch --no-contains 3050fc0d3 +# patch-3 +# patch-4 +```