Skip to content

Instantly share code, notes, and snippets.

@bittner
Forked from chrisberkhout/.bash_profile
Last active February 28, 2025 11:28
Show Gist options
  • Select an option

  • Save bittner/22ad4c5c71967f7a5ec7a6e5fc8c098d to your computer and use it in GitHub Desktop.

Select an option

Save bittner/22ad4c5c71967f7a5ec7a6e5fc8c098d to your computer and use it in GitHub Desktop.

Revisions

  1. bittner revised this gist Mar 14, 2024. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions .bash_ohmyzsh
    Original file line number Diff line number Diff line change
    @@ -29,8 +29,11 @@ alias gp="git push"
    alias gpf="git push -f"
    alias gpu="git push -u"
    alias gd="git diff"
    alias gdw="git diff -w"
    alias gdc="git diff --cached"
    alias gdcw="git diff --cached -w"
    alias gds="git diff --staged"
    alias gdsw="git diff --staged -w"
    function gdv() { # mine doesn't add -w
    git diff $@ | vim -R -
    }
    @@ -71,10 +74,10 @@ alias grh="git reset HEAD"
    alias grhh="git reset HEAD --hard"
    alias gclean="git reset --hard && git clean -dfx"
    alias gwc="git whatchanged -p --abbrev-commit --pretty=medium"
    alias gsts="git stash show --text"
    alias gsta="git stash"
    alias gstp="git stash pop"
    alias gstd="git stash drop"
    alias gstp="git stash pop"
    alias gsts="git stash show --text"
    alias gt="git tag"
    alias gtd="git tag -d"
    function ggpull {
  2. bittner revised this gist Feb 26, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .bash_ohmyzsh
    Original file line number Diff line number Diff line change
    @@ -66,6 +66,7 @@ alias gss="git status -s"
    alias ga="git add"
    alias gav="git add -v"
    alias gm="git merge"
    alias gmv="git mv"
    alias grh="git reset HEAD"
    alias grhh="git reset HEAD --hard"
    alias gclean="git reset --hard && git clean -dfx"
  3. bittner revised this gist Feb 20, 2024. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions .bash_ohmyzsh
    Original file line number Diff line number Diff line change
    @@ -74,6 +74,8 @@ alias gsts="git stash show --text"
    alias gsta="git stash"
    alias gstp="git stash pop"
    alias gstd="git stash drop"
    alias gt="git tag"
    alias gtd="git tag -d"
    function ggpull {
    git pull origin $(git_current_branch)
    }
  4. bittner revised this gist Feb 6, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .bash_ohmyzsh
    Original file line number Diff line number Diff line change
    @@ -86,6 +86,6 @@ function ggpush {
    function ggpnp {
    git pull origin $(git_current_branch) && git push origin $(git_current_branch)
    }
    function glp(){
    function glp() {
    git log --pretty=$@
    }
  5. bittner revised this gist Feb 6, 2024. 1 changed file with 10 additions and 9 deletions.
    19 changes: 10 additions & 9 deletions .bash_ohmyzsh
    Original file line number Diff line number Diff line change
    @@ -12,6 +12,14 @@ function git_current_repository() {
    echo $(git remote -v | cut -d':' -f 2)
    }
    alias g="git"
    alias gb="git branch"
    alias gba="git branch -a"
    alias gbd="git branch -d"
    alias gbD="git branch -D"
    alias gbr="git branch -r"
    alias gcount="git shortlog -sn"
    alias gcl="git config --list"
    alias gcp="git cherry-pick"
    alias gs="git status"
    alias gsh="git show"
    alias gst="git status"
    @@ -46,16 +54,9 @@ alias grrm="git remote remove"
    alias gsetr="git remote set-url"
    alias grup="git remote update"
    alias grb="git rebase"
    alias grbi="git rebase -i"
    alias grbc="git rebase --continue"
    alias grba="git rebase --abort"
    alias gb="git branch"
    alias gba="git branch -a"
    alias gbd="git branch -d"
    alias gbD="git branch -D"
    alias gcount="git shortlog -sn"
    alias gcl="git config --list"
    alias gcp="git cherry-pick"
    alias grbc="git rebase --continue"
    alias grbi="git rebase -i"
    alias glg="git log --stat --max-count=10"
    alias glgg="git log --graph --max-count=10"
    alias glgga="git log --graph --decorate --all"
  6. bittner revised this gist Mar 16, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .bash_ohmyzsh
    Original file line number Diff line number Diff line change
    @@ -45,6 +45,7 @@ alias grmv="git remote rename"
    alias grrm="git remote remove"
    alias gsetr="git remote set-url"
    alias grup="git remote update"
    alias grb="git rebase"
    alias grbi="git rebase -i"
    alias grbc="git rebase --continue"
    alias grba="git rebase --abort"
  7. bittner revised this gist Mar 13, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .bash_ohmyzsh
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,7 @@ function git_current_repository() {
    }
    alias g="git"
    alias gs="git status"
    alias gsh="git show"
    alias gst="git status"
    alias gl="git pull"
    alias gup="git pull --rebase"
  8. bittner revised this gist Mar 13, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .bash_ohmyzsh
    Original file line number Diff line number Diff line change
    @@ -38,6 +38,7 @@ alias gcmsg="git commit -m"
    alias gco="git checkout"
    alias gcob="git checkout -b"
    alias gr="git remote"
    alias grm="git rm"
    alias grv="git remote -v"
    alias grmv="git remote rename"
    alias grrm="git remote remove"
  9. bittner revised this gist Mar 11, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .bash_ohmyzsh
    Original file line number Diff line number Diff line change
    @@ -49,6 +49,7 @@ alias grba="git rebase --abort"
    alias gb="git branch"
    alias gba="git branch -a"
    alias gbd="git branch -d"
    alias gbD="git branch -D"
    alias gcount="git shortlog -sn"
    alias gcl="git config --list"
    alias gcp="git cherry-pick"
  10. bittner renamed this gist Mar 11, 2022. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion .bash_profile → .bash_ohmyzsh
    Original file line number Diff line number Diff line change
    @@ -12,12 +12,16 @@ function git_current_repository() {
    echo $(git remote -v | cut -d':' -f 2)
    }
    alias g="git"
    alias gs="git status"
    alias gst="git status"
    alias gl="git pull"
    alias gup="git pull --rebase"
    alias gp="git push"
    alias gpf="git push -f"
    alias gpu="git push -u"
    alias gd="git diff"
    alias gdc="git diff --cached"
    alias gds="git diff --staged"
    function gdv() { # mine doesn't add -w
    git diff $@ | vim -R -
    }
    @@ -28,9 +32,11 @@ alias gc="git commit -v"
    alias gc!="git commit -v --amend"
    alias gca="git commit -v -a"
    alias gca!="git commit -v -a --amend"
    alias gcn!="git commit -v --amend --no-edit"
    alias gcm="git commit -m"
    alias gcmsg="git commit -m"
    alias gco="git checkout"
    alias gcm="git checkout master"
    alias gcob="git checkout -b"
    alias gr="git remote"
    alias grv="git remote -v"
    alias grmv="git remote rename"
    @@ -42,6 +48,7 @@ alias grbc="git rebase --continue"
    alias grba="git rebase --abort"
    alias gb="git branch"
    alias gba="git branch -a"
    alias gbd="git branch -d"
    alias gcount="git shortlog -sn"
    alias gcl="git config --list"
    alias gcp="git cherry-pick"
    @@ -52,6 +59,7 @@ alias glo="git log --oneline --decorate --color"
    alias glog="git log --oneline --decorate --color --graph"
    alias gss="git status -s"
    alias ga="git add"
    alias gav="git add -v"
    alias gm="git merge"
    alias grh="git reset HEAD"
    alias grhh="git reset HEAD --hard"
  11. @chrisberkhout chrisberkhout created this gist Jan 25, 2017.
    78 changes: 78 additions & 0 deletions .bash_profile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,78 @@
    # git aliases - taken from oh-my-zsh's git plugin and translated to bash
    # https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet#helpful-aliases-for-common-git-tasks
    # https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh
    function git_current_branch() {
    ref=$(git symbolic-ref HEAD 2> /dev/null) || \
    ref=$(git rev-parse --short HEAD 2> /dev/null) || return
    echo ${ref#refs/heads/}
    }
    function git_current_repository() {
    ref=$(git symbolic-ref HEAD 2> /dev/null) || \
    ref=$(git rev-parse --short HEAD 2> /dev/null) || return
    echo $(git remote -v | cut -d':' -f 2)
    }
    alias g="git"
    alias gst="git status"
    alias gl="git pull"
    alias gup="git pull --rebase"
    alias gp="git push"
    alias gd="git diff"
    alias gdc="git diff --cached"
    function gdv() { # mine doesn't add -w
    git diff $@ | vim -R -
    }
    function gdcv() { # my own
    git diff --cached $@ | vim -R -
    }
    alias gc="git commit -v"
    alias gc!="git commit -v --amend"
    alias gca="git commit -v -a"
    alias gca!="git commit -v -a --amend"
    alias gcmsg="git commit -m"
    alias gco="git checkout"
    alias gcm="git checkout master"
    alias gr="git remote"
    alias grv="git remote -v"
    alias grmv="git remote rename"
    alias grrm="git remote remove"
    alias gsetr="git remote set-url"
    alias grup="git remote update"
    alias grbi="git rebase -i"
    alias grbc="git rebase --continue"
    alias grba="git rebase --abort"
    alias gb="git branch"
    alias gba="git branch -a"
    alias gcount="git shortlog -sn"
    alias gcl="git config --list"
    alias gcp="git cherry-pick"
    alias glg="git log --stat --max-count=10"
    alias glgg="git log --graph --max-count=10"
    alias glgga="git log --graph --decorate --all"
    alias glo="git log --oneline --decorate --color"
    alias glog="git log --oneline --decorate --color --graph"
    alias gss="git status -s"
    alias ga="git add"
    alias gm="git merge"
    alias grh="git reset HEAD"
    alias grhh="git reset HEAD --hard"
    alias gclean="git reset --hard && git clean -dfx"
    alias gwc="git whatchanged -p --abbrev-commit --pretty=medium"
    alias gsts="git stash show --text"
    alias gsta="git stash"
    alias gstp="git stash pop"
    alias gstd="git stash drop"
    function ggpull {
    git pull origin $(git_current_branch)
    }
    function ggpur {
    git pull --rebase origin $(git_current_branch)
    }
    function ggpush {
    git push origin $(git_current_branch)
    }
    function ggpnp {
    git pull origin $(git_current_branch) && git push origin $(git_current_branch)
    }
    function glp(){
    git log --pretty=$@
    }