Skip to content

Instantly share code, notes, and snippets.

@nicolasromer
Last active December 5, 2022 11:05
Show Gist options
  • Save nicolasromer/1efc107daf474203803f0544731d1455 to your computer and use it in GitHub Desktop.
Save nicolasromer/1efc107daf474203803f0544731d1455 to your computer and use it in GitHub Desktop.
Bash Profile
#
# Bash Profile management
#
alias profile="vim ~/.bash_profile"
alias catprofile="cat ~/.bash_profile"
# source profile
alias sp="source ~/.bash_profile"
alias sourcep="source ~/.bash_profile"
# search profile for alias
getalias() {
grep_term="$1"
cat ~/.bash_profile | grep $grep_term
}
#
# git
#
alias gs="git status"
alias gp="git pull"
alias gpr="git pull --rebase"
alias gbl="git branch --list"
alias gau="git add -u"
alias gd="git diff"
alias gca="git commit --amend"
alias uncommit="git reset --soft HEAD^ && git reset HEAD ."
gc() {
commit_message="$1"
echo $commit_message
git commit -m "$commit_message"
}
gcb() {
branch_name="$(git symbolic-ref HEAD 2>/dev/null)" ||
branch_name="(unnamed branch)" # detached HEAD
branch_name=${branch_name##refs/heads/}
commit_message="$branch_name: $1"
echo $commit_message
git commit -m "$commit_message"
}
alias gitpush="git push"
# listing
alias la="ls -lah"
alias ll="ls -FGlAhp"
# navigating
alias ..="cd .."
# fun
alias weather="curl http://wttr.in/amsterdam"
alias moon="curl wttr.in/moon"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment