Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
git bash scripts
# Problem: Build servers check out tags to build them but we need to deploy our code based on the branch the code came from.
# Solution: Get branches containing the tag, figure out which one has the tagged commit as its head
$ git branch --contains tags/some-tag
* (HEAD detached at some-tag)
demo/carlin
demo/steve
$ git diff --shortstat demo/steve some-tag
4 files changed, 9 insertions(+), 20 deletions(-)
$ git diff --shortstat demo/carlin some-tag
# demo/carlin matches some-tag so that must be the branch we built from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.