Skip to content

Instantly share code, notes, and snippets.

@mandemeskel
Last active June 9, 2018 18:47
Show Gist options
  • Save mandemeskel/f385949ebf9a493a6004a159b4132c03 to your computer and use it in GitHub Desktop.
Save mandemeskel/f385949ebf9a493a6004a159b4132c03 to your computer and use it in GitHub Desktop.
Bash Script to Create Git Aliases
#!/bin/bash
# https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases
# 'git checkout' becomes 'git ch'
git config --global alias.ch checkout
git config --global alias.c commit
git config --global alias.s status
git config --global alias.sh stash
git config --global alias.b branch
git config --global alias.a add
git config --global alias.d diff
git config --global alias.pl pull
git config --global alias.ps push
# these two need to be run within a git repo to work
# git config —-global user.email GITHUB_USERNAME@users.noreply.github.com
# git config —-global user.name GITHUB_USERNAMAE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment