Skip to content

Instantly share code, notes, and snippets.

@wes-goulet
Last active December 22, 2021 19:51
Show Gist options
  • Save wes-goulet/16ad9bc1b711a3b5a493571029012e1c to your computer and use it in GitHub Desktop.
Save wes-goulet/16ad9bc1b711a3b5a493571029012e1c to your computer and use it in GitHub Desktop.
aliases for bash on windows
alias gs='git status'
alias ga='git add --all'
alias gf='git fetch --all --prune'
alias gsu='git submodule sync && git submodule update --init --recursive'
alias repos='cd ~/Source/Repos'
alias sln='start *.sln'
alias startssh='eval `ssh-agent -s` && ssh-add ~/.ssh/id_rsa'
alias gt='echo Fetch then show local tags: && git fetch --tags && git tag -l --sort=v:refname'
alias gtu='echo Fetch upstream then show local tags: && git fetch --tags upstream && git tag -l --sort=v:refname'
alias grt='echo Remote Tags: && git ls-remote --tags | sort -t '"'"'/'"'"' -k 3 -V | awk '"'"'{print $2}'"'"' | grep -v "{}"'
alias grtu='echo Remote Upstream Tags: && git ls-remote --tags upstream | sort -t '"'"'/'"'"' -k 3 -V | awk '"'"'{print $2}'"'"' | grep -v "{}"'
@wes-goulet
Copy link
Author

wes-goulet commented Feb 14, 2017

  1. Configure git bash

    1. Open Git Bash

    2. Generate SSH Keys:

      mkdir ~/.ssh
      cd ~/.ssh
      ssh-keygen -t rsa -b 4096 -C "<your email here>"
      
    3. Add your public key to github

      clip < ~/.ssh/id_rsa.pub
      
      # or on mac
      cat ~/.ssh/id_rsa.pub | pbcopy
      
    4. Add the following lines to ~/.bash_profile

      if [ -f ~/.bash_aliases ]; then
      . ~/.bash_aliases
      fi
      
    5. Add some useful aliases (from this gist, feel free to use your own aliases, although the remaining commands below assume the given aliases were used)

      curl -o ~/.bash_aliases https://gist.githubusercontent.com/wes566/16ad9bc1b711a3b5a493571029012e1c/raw/.bash_aliases
      source ~/.bash_aliases
      mkdir ~/Source && mkdir ~/Source/Repos
      repos
      

@wes-goulet
Copy link
Author

This list is mostly deprecated, been keeping the alias list up to date in my .zshrc gist

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