Skip to content

Instantly share code, notes, and snippets.

@aremu-smog
Created December 30, 2022 18:54
Show Gist options
  • Select an option

  • Save aremu-smog/8556d63829c717c9cdcd83daec2c6138 to your computer and use it in GitHub Desktop.

Select an option

Save aremu-smog/8556d63829c717c9cdcd83daec2c6138 to your computer and use it in GitHub Desktop.
A collection of git aliases I use.

A list of aliases I use to improve my workflow with git

Copy and paste the code below into your .bash_profile or .zshrc if you use zsh

# stage and commit files
alias gac="git add . & git commit"
# git push
alias gp="git push"
# checkout branch
alias gcb ="git checkout"
# create new branch
alias gcb="git checkout -b"
# git push new branch to remote
alias gpn="git push -u origin"

How to use

Run nano ~/.bash_profile or nano ~/.zshrc based on the commandline you are using. You can replace nano with vim or vi if that's your preference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment