How to validate whether the commit with given sha exists in current branch?
There are many ways to parse outputs, but I need optimal way which returns boolean (for u
git rev-list branch-youre-interested-in | grep -q sha-youre-interested-in
You can use the exit code from grep in conditionals.
For the current branch,
git rev-list HEAD | grep -q sha-youre-interested-in