Last active
April 23, 2021 18:30
-
-
Save mtlynch/80b3e46e239b8cd1355da0c1a7548329 to your computer and use it in GitHub Desktop.
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
function git_sync_and_branch { | |
local readonly TARGET_BRANCH="$1" | |
git checkout master && \ | |
git pull origin master | |
if [[ ! -z "$TARGET_BRANCH" ]]; then | |
git checkout -b "${TARGET_BRANCH}" | |
fi | |
} | |
alias gcbm='git_sync_and_branch' # Sync master and check out new branch | |
alias gau='git add --update' | |
alias ga='git add -A' | |
alias gb='git branch -v --sort=committerdate' | |
alias gc='git commit -m' | |
alias gs='git status' | |
alias gu='git reset --soft HEAD~1' # Git undo | |
alias gd='git diff --cached' | |
alias gss='git stash save' | |
alias gsp='git stash pop' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment