Last active
December 16, 2019 11:11
-
-
Save fosemberg/9d7b80b2878be5b341098996e7064716 to your computer and use it in GitHub Desktop.
git config for project. add projectPrefix while checkouting (Win10 x64 WSL Ubuntu 18.04)
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-; \ | |
if [ $1 = "d" ] || [ $1 = "dev" ] || [ $1 = "develop" ]; then \ | |
git checkout develop; \ | |
elif [ $1 = "m" ] || [ $1 = "master" ] || [ $1 = "v2" ]; then \ | |
git checkout v2; \ | |
elif [ $1 != "$projectPrefix"* ]; then \ | |
git checkout $projectPrefix$1; \ | |
else \ | |
git checkout $1; \ | |
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