Skip to content

Instantly share code, notes, and snippets.

@aprotyas
Created April 25, 2023 23:57
Show Gist options
  • Save aprotyas/11e07986efc6d9dd5b9b44bd7dc34b41 to your computer and use it in GitHub Desktop.
Save aprotyas/11e07986efc6d9dd5b9b44bd7dc34b41 to your computer and use it in GitHub Desktop.
git contains: Check if given commit exists in current checkout state
[alias]
contains = "!f() { \
if git merge-base --is-ancestor $1 HEAD; then \
echo I contain commit $1; \
else \
echo I do not contain commit $1; \
fi \
}; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment