Skip to content

Instantly share code, notes, and snippets.

@fosemberg
Last active December 16, 2019 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fosemberg/9d7b80b2878be5b341098996e7064716 to your computer and use it in GitHub Desktop.
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)
...
[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