Aliasing (.zshrc)

Notes & Setup

For Zsh

  1. Edit .zshrc:

    • Open your .zshrc file in your home directory with a text editor.

    • Command: nano ~/.zshrc

  2. Add the Alias:

    • Add the following line at the end of the file:

      zshCopy codealias ga='git add -A'
  3. Reload the Configuration:

    • After saving the file, reload the configuration by running:

      zshCopy codesource ~/.zshrc
    • Or close and reopen your terminal.

For Bash

  1. Edit .bashrc or .bash_profile:

    • Open your .bashrc file in your home directory with a text editor. If you are on macOS, you might want to edit .bash_profile instead.

    • Command: nano ~/.bashrc (or nano ~/.bash_profile for macOS)

  2. Add the Alias:

    • Add the following line at the end of the file:

      bashCopy codealias ga='git add -A'
  3. Reload the Configuration:

    • After saving the file, reload the configuration by running:

      bashCopy codesource ~/.bashrc
    • Or simply close and reopen your terminal.

For Fish

  1. Use alias Command:

    • In Fish, you can create an alias using the alias command and then save it.

    • Run:

      fishCopy codealias ga='git add -A'
      funcsave ga

Notes:

  • These changes will only apply to your user on your current machine. If you use multiple machines or accounts, you'll need to repeat this process for each one.

  • If you're not sure which shell you are using, you can usually find out by running echo $SHELL in your terminal.

  • Remember that aliases are a great way to save time on frequently used commands, but they are local to your shell and won't be available in scripts or on other machines unless you define them there as well.

Aaron's Personal Preference
alias cl='clear'
alias d='npm run dev'
alias s='npm run start'
alias b='npm run build'

alias ga='git add -A'
alias gs='git status'
alias gp='git push'
alias gl='git pull'
alias gf='git fetch'
alias gc='git checkout'
alias gb='git branch'
alias gd='git diff'
alias gmg='git merge'
alias glg='git log'
alias gsta='git stash'
alias gstp='git stash pop'
alias grb='git rebase'
alias grbc='git rebase --continue'
alias grba='git rebase --abort'

alias ylf='yarn lint:format'

gm() {
    git commit -m "$*"
}

Last updated