Created
June 8, 2017 18:18
-
-
Save carlin-q-scott/b901f2c521499a282c0ab85ca0adce01 to your computer and use it in GitHub Desktop.
git bash scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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