Skip to content

Instantly share code, notes, and snippets.

@DustinAlandzes
Last active June 5, 2022 00:24
Show Gist options
  • Save DustinAlandzes/f173bb4266030b8f2fcf78601c58cb52 to your computer and use it in GitHub Desktop.
Save DustinAlandzes/f173bb4266030b8f2fcf78601c58cb52 to your computer and use it in GitHub Desktop.
My .bashrc file
# welcome to my .bashrc!
if [[ $(uname -s) == "darwin" ]]; then
# brew on osx
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# empty commit
alias empty-commit='git commit --allow-empty -m "this is an empty commit"'
# current branch
alias current-branch='git branch | grep "*" | cut -c 3-'
# push the current branch
alias push-current-branch='current-branch | xargs git push --set-upstream origin'
# shortcut to make a python 3 virtual environment
alias create-venv='python3 -m venv venv'
# shortcut for pip freeze > requirements.txt
alias pip-freeze-arrow-requirements-txt='pip freeze > requirements.txt'
# docker compose (overwriting
alias dc='docker-compose'
# autocompleteable shortcut for dc logs --tail="10" -f
alias dc-logs-tail-follow='dc logs --tail="10" -f'
# for git commit signing in pycharm: https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html
GPG_TTY=$(tty)
export GPG_TTY
# use fish if available, install with brew install fish
if [[ $(cat /etc/shells) == *"/opt/homebrew/bin/fish"* ]]; then
export fish_greeting=""
exec /opt/homebrew/bin/fish
fi
@DustinAlandzes
Copy link
Author

DustinAlandzes commented Jun 1, 2022

On OSX, first change to bash from zsh using

chsh -s /bin/bash

~/.bash_profile is used instead too, so add this to .bash_profile and use .bashrc as usual.

if [ -f $HOME/.bashrc ]; then
        source $HOME/.bashrc
fi

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