Skip to content

Instantly share code, notes, and snippets.

@fgdaniel
Last active November 15, 2021 13:07
Show Gist options
  • Save fgdaniel/1ec6cfe0169f557598a09a7fc20bdaed to your computer and use it in GitHub Desktop.
Save fgdaniel/1ec6cfe0169f557598a09a7fc20bdaed to your computer and use it in GitHub Desktop.
bash aliases commands
# ----------------------
# Git Command Aliases
# ----------------------
# Arg1 = target branch
function add_branch() {
git checkout -b $1 && git push -u origin $1
}
alias add_branch=add_branch
# Arg1 = target branch
function remove_branch() {
git checkout master && git branch -d $1 && git push -d origin $1
}
alias remove_branch=remove_branch
# Arg1 = target branch
function checkout() {
git checkout $1
}
alias checkout=checkout
# Arg1 = target branch
function merge() {
git checkout master && git merge --no-ff $1 && git push origin $1 && git branch -d $1 && git push -d origin $1
}
alias merge=merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment