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
#!/usr/bin/env bash | |
set -e | |
ROOT=$(pwd) | |
BRANCH=$(gh pr view --json headRefName --jq .headRefName $1) | |
WORKTREE=worktrees/${BRANCH//\//-} | |
git fetch origin ${BRANCH} | |
git worktree add ${WORKTREE} ${BRANCH} | |
cd ${WORKTREE} |
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
#!/usr/bin/env bash | |
## constants ## | |
readonly USE_ANSI_COLOR=$( ([[ "$GBS_USE_ANSI_COLOR" =~ ^[01]$ ]] && echo -n "$GBS_USE_ANSI_COLOR") || | |
([[ "$CFG_USE_ANSI_COLOR" =~ ^[01]$ ]] && echo -n "$CFG_USE_ANSI_COLOR") || | |
echo -n '1') | |
readonly CBLUE=$( (($USE_ANSI_COLOR)) && echo '\033[1;34m') | |
readonly CTHINBLUE=$( (($USE_ANSI_COLOR)) && echo '\e[0;34m') | |
readonly CEND=$( (($USE_ANSI_COLOR)) && echo '\033[0m') |
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 = checkout | |
br = branch | |
ci = commit | |
st = status | |
last = log -1 | |
glog = log --graph --abbrev-commit --pretty=format:'%C(yellow)%h %C(blue)[%G?] %C(green)(%cr)%C(reset) %s' | |
olog = log --color --abbrev-commit --pretty=format:'%C(yellow)%h %C(blue)[%G?] %C(green)(%cr)%C(reset) %s' | |
tlog = log --color --abbrev-commit --pretty=format:'%ct %H' | |
unstage = restore --staged |