Created
November 6, 2019 09:13
-
-
Save fosemberg/437da6e87e82a69c65cd410de4e3a8be to your computer and use it in GitHub Desktop.
git config for project. add projectPrefix while checkouting
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
... | |
[alias] | |
co = "!f() { \ | |
local projectPrefix=DITBL-; \ | |
local branch=$1; \ | |
if [[ "$1" != "$projectPrefix"* ]]; then \ | |
branch=$projectPrefix$branch; \ | |
fi; \ | |
if [[ $1 = "d" || $1 = "dev" || $1 = "develop" ]]; then \ | |
git checkout develop; \ | |
elif [[ $1 = "m" || $1 = "master" || $1 = "v2" ]]; then \ | |
git checkout v2; \ | |
else \ | |
git checkout $branch; \ | |
fi \ | |
}; f" | |
cob = "!f() { \ | |
local projectPrefix=DITBL-; \ | |
local branch=$1; \ | |
if [[ "$1" != "$projectPrefix"* ]]; then \ | |
branch=$projectPrefix$branch; \ | |
fi; \ | |
git checkout -b $branch; \ | |
}; f" | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment