Created
April 5, 2018 17:42
-
-
Save greenbicycle/c1d4d2ebe15f7ce9e69c53b45488a00d to your computer and use it in GitHub Desktop.
find branch name in git based on Manuscript case number
This file contains hidden or 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
| #!/bin/bash | |
| # | |
| # Find a branch name based on the Manuscript case number | |
| # | |
| # $1 should be a manuscript case number | |
| # It will be copied to the clipboard | |
| # | |
| # sed is for removing the '* ' from the beginning of the line | |
| # tr removes the newline at the end | |
| BRANCH=$(git branch | grep $1 | sed 's/^..//' | tr -d "\n") | |
| # If you are not on a Mac, remove the pbcopy | |
| # Then the branch name will go to stdout | |
| printf $BRANCH | pbcopy |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use Manuscript (formerly known as Fogbugz). This helps me find the branch easily when i am merging.