Skip to content

Commit

Permalink
✨ Add git aliases 'squashlast' and 'alias'
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelange committed Nov 24, 2020
1 parent 3c04305 commit e57e97f
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 66 deletions.
21 changes: 12 additions & 9 deletions .bash_profile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export PATH="/usr/local/sbin:/usr/local/bin:$PATH"
export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/2.7.0/bin:$PATH" # homebrew ruby first in PATH
export PATH="${HOME}/.cargo/bin:$PATH" # rust binary installation path
export PATH="/Library/TeX/texbin:$PATH" # mactex binary installation path (brew cask install mactex)

# bash completion and integration

Expand Down Expand Up @@ -41,17 +42,19 @@ function cd {
fi
}

alias back="cd -"
alias ls="exa --all --group-directories-first --icons --level=2" # default level for --tree
alias ll="ls --long --sort=age --git --time=modified --time-style=iso"
alias h="history | tail -n 25"
alias cls="printf \"\033c\""
alias dff="icdiff --highlight --line-numbers --numlines=3"
alias gcc="gcc-8"
alias moji="git status && git add . && pre-commit && gitmoji -c"
alias git-summary=/Users/david.de-lange/git/git-summary/git-summary
alias back='cd -'
alias ls='exa --all --group-directories-first --icons --level=2' # default level for --tree
alias ll='ls --long --sort=age --git --time=modified --time-style=iso'
alias h='history | tail -n 25'
alias cls='printf "\033c"'
alias dff='icdiff --highlight --line-numbers --numlines=3'
alias gcc='gcc-8'
alias moji='git status && git add . && pre-commit && gitmoji -c'
alias git-summary='~/git/git-summary/git-summary'
alias s='subl'
alias sm='smerge'
alias xdg-open='open'



# bash_history
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,13 @@ git config --global alias.lg "log --graph --decorate --pretty=oneline --abbrev-c
git config --global alias.fp "fetch -p --all" # purge and fetch all remotes
git config --global alias.defaultbranch '! f() { echo $(git remote show origin | grep "HEAD branch" | cut -d ":" -f 2 | xargs); }; f' # https://stackoverflow.com/questions/28666357#comment101797372_50056710
git config --global alias.df '! f() { git icdiff --color=always "$@" | less -eR; }; f' # no FX (keep output in terminal)
git config --global alias.pr '! git push --set-upstream origin "$(git rev-parse --abbrev-ref HEAD)"'
git config --global alias.pr '! git push --set-upstream origin "$(git rev-parse --abbrev-ref HEAD)"' # push a new branch. will be overwritten if git-extras is installed
git config --global alias.dm '! git fetch -p && for branch in `git branch -vv | grep '"': gone] ' | awk '"'{print $1}'"'"'`; do git branch -D $branch; done' # 'delete merged' - local branches that have been deleted on remote
git config --global alias.gg '! f() { git checkout "${1:-$(git defaultbranch)}" && git dm && git pull; }; f' # git gg develop -- no arg: defaultbranch. Return to default branch (or specified branch), delete merged, pull branch
git config --global alias.pall '! f() { START=$(git branch | grep "\*" | sed "s/^.//"); for i in $(git branch | sed "s/^.//"); do git checkout $i; git pull || break; done; git checkout $START; }; f' # 'pull all' - pull local branches that have been updated on remote
git config --global alias.undo '! f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f' # https://megakemp.com/2016/08/25/git-undo/
git config --global alias.squashlast '"!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"' # Squash the last x commits; will prompt you with auto-squashed commit messages
git config --global alias.alias "! git config --get-regexp '^alias\.' | sed -e s/^alias\.// | grep -v ^'alias ' | sed 's/ /#/' | column -ts#"
```


Expand Down
159 changes: 103 additions & 56 deletions com.googlecode.iterm2.plist
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Maximize Active Pane</string>
<key>NSWindow Frame SharedPreferences</key>
<string>243 306 937 514 0 0 1440 877 </string>
<key>NSWindow Frame iTerm Window 0</key>
<string>0 0 1440 877 0 0 1440 877 </string>
<string>0 23 1440 854 0 0 1440 877 </string>
<key>NSWindow Frame iTerm Window 1</key>
<string>0 0 1440 877 0 0 1440 877 </string>
<key>New Bookmarks</key>
Expand All @@ -218,34 +218,34 @@ Maximize Active Pane</string>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<real>0.30978869999999997</real>
<key>Green Component</key>
<real>0.0</real>
<real>0.30978869999999997</real>
<key>Red Component</key>
<real>0.0</real>
<real>0.30978869999999997</real>
</dict>
<key>Ansi 1 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<real>0.37647059999999999</real>
<key>Green Component</key>
<real>0.0</real>
<real>0.4235294</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
<real>1</real>
</dict>
<key>Ansi 10 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<real>0.67277030000000004</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
<real>0.80941479999999999</real>
</dict>
<key>Ansi 11 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<real>0.7996491</real>
<key>Green Component</key>
<real>1</real>
<key>Red Component</key>
Expand All @@ -254,29 +254,29 @@ Maximize Active Pane</string>
<key>Ansi 12 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<real>0.9982605</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<real>0.86277559999999998</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
<real>0.71165029999999996</real>
</dict>
<key>Ansi 13 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<real>0.99652090000000004</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<real>0.61330589999999996</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Ansi 14 Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<real>0.99703969999999997</real>
<key>Green Component</key>
<real>1</real>
<real>0.87631029999999999</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
<real>0.87591359999999996</real>
</dict>
<key>Ansi 15 Color</key>
<dict>
Expand All @@ -290,72 +290,72 @@ Maximize Active Pane</string>
<key>Ansi 2 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<real>0.37647059999999999</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<real>1</real>
<key>Red Component</key>
<real>0.0</real>
<real>0.65882350000000001</real>
</dict>
<key>Ansi 3 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<real>0.71372550000000001</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<real>1</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
<real>1</real>
</dict>
<key>Ansi 4 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<real>0.99607840000000003</real>
<key>Green Component</key>
<real>0.0</real>
<real>0.79607839999999996</real>
<key>Red Component</key>
<real>0.0</real>
<real>0.58823530000000002</real>
</dict>
<key>Ansi 5 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<real>0.99215690000000001</real>
<key>Green Component</key>
<real>0.0</real>
<real>0.4509804</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
<real>1</real>
</dict>
<key>Ansi 6 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<real>0.99607840000000003</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<real>0.77254900000000004</real>
<key>Red Component</key>
<real>0.0</real>
<real>0.77647060000000001</real>
</dict>
<key>Ansi 7 Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<real>0.93353169999999996</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<real>0.93353169999999996</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
<real>0.93353169999999996</real>
</dict>
<key>Ansi 8 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<real>0.4862745</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<real>0.4862745</real>
<key>Red Component</key>
<real>0.3333333432674408</real>
<real>0.4862745</real>
</dict>
<key>Ansi 9 Color</key>
<dict>
<key>Blue Component</key>
<real>0.3333333432674408</real>
<real>0.69019609999999998</real>
<key>Green Component</key>
<real>0.3333333432674408</real>
<real>0.71372550000000001</real>
<key>Red Component</key>
<real>1</real>
</dict>
Expand All @@ -372,6 +372,19 @@ Maximize Active Pane</string>
</dict>
<key>Background Image Location</key>
<string></string>
<key>Badge Color</key>
<dict>
<key>Alpha Component</key>
<real>0.5</real>
<key>Blue Component</key>
<real>0.0</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.1491314172744751</real>
<key>Red Component</key>
<real>1</real>
</dict>
<key>Blinking Cursor</key>
<false/>
<key>Blur</key>
Expand All @@ -396,11 +409,24 @@ Maximize Active Pane</string>
<key>Cursor Color</key>
<dict>
<key>Blue Component</key>
<real>0.73333334922790527</real>
<real>0.37647059999999999</real>
<key>Green Component</key>
<real>0.73333334922790527</real>
<real>0.64705880000000005</real>
<key>Red Component</key>
<real>0.73333334922790527</real>
<real>1</real>
</dict>
<key>Cursor Guide Color</key>
<dict>
<key>Alpha Component</key>
<real>0.25</real>
<key>Blue Component</key>
<real>1</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.9268307089805603</real>
<key>Red Component</key>
<real>0.70213186740875244</real>
</dict>
<key>Cursor Text Color</key>
<dict>
Expand Down Expand Up @@ -730,6 +756,19 @@ Maximize Active Pane</string>
<string>[1;5F</string>
</dict>
</dict>
<key>Link Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.73423302173614502</real>
<key>Color Space</key>
<string>sRGB</string>
<key>Green Component</key>
<real>0.35916060209274292</real>
<key>Red Component</key>
<real>0.0</real>
</dict>
<key>Mouse Reporting</key>
<true/>
<key>Name</key>
Expand All @@ -755,20 +794,20 @@ Maximize Active Pane</string>
<key>Selected Text Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<real>0.94760049999999996</real>
<key>Green Component</key>
<real>0.0</real>
<real>0.94760049999999996</real>
<key>Red Component</key>
<real>0.0</real>
<real>0.94760049999999996</real>
</dict>
<key>Selection Color</key>
<dict>
<key>Blue Component</key>
<real>1</real>
<real>0.51530609999999999</real>
<key>Green Component</key>
<real>0.8353000283241272</real>
<real>0.22248570000000001</real>
<key>Red Component</key>
<real>0.70980000495910645</real>
<real>0.20990739999999999</real>
</dict>
<key>Send Code When Idle</key>
<false/>
Expand Down Expand Up @@ -807,10 +846,11 @@ Maximize Active Pane</string>
<key>NoSyncAllAppVersions</key>
<array>
<string>3.3.9</string>
<string>3.3.6</string>
<string>3.2.8</string>
<string>3.3.0</string>
<string>3.3.7</string>
<string>3.3.6</string>
<string>3.3.12</string>
</array>
<key>NoSyncBFPRecents</key>
<array>
Expand All @@ -821,6 +861,13 @@ Maximize Active Pane</string>
</array>
<key>NoSyncCommandHistoryHasEverBeenUsed</key>
<true/>
<key>NoSyncFrame_SessionsPreferences</key>
<dict>
<key>screenFrame</key>
<string>{{0, 0}, {1440, 900}}</string>
<key>topLeft</key>
<string>{417, 794}</string>
</dict>
<key>NoSyncFrame_SharedPreferences</key>
<dict>
<key>screenFrame</key>
Expand All @@ -837,7 +884,7 @@ Maximize Active Pane</string>
<key>NoSyncLastTipTime</key>
<real>593204423.13678098</real>
<key>NoSyncLaunchExperienceControllerRunCount</key>
<integer>62</integer>
<integer>93</integer>
<key>NoSyncNeverRemindPrefsChangesLostForFile</key>
<true/>
<key>NoSyncNeverRemindPrefsChangesLostForFile_selection</key>
Expand Down Expand Up @@ -1645,6 +1692,8 @@ Maximize Active Pane</string>
<true/>
<key>OpenNoWindowsAtStartup</key>
<false/>
<key>OpenTmuxWindowsIn</key>
<integer>0</integer>
<key>PMPrintingExpandedStateForPrint2</key>
<false/>
<key>PasteSpecialChunkDelay</key>
Expand Down Expand Up @@ -1705,11 +1754,9 @@ Maximize Active Pane</string>
<key>SUHasLaunchedBefore</key>
<true/>
<key>SULastCheckTime</key>
<date>2020-05-11T09:25:07Z</date>
<date>2020-10-30T10:17:39Z</date>
<key>SUSendProfileInfo</key>
<false/>
<key>SUSkippedVersion</key>
<string>3.3.9</string>
<key>SUUpdateRelaunchingMarker</key>
<false/>
<key>ShowBookmarkName</key>
Expand Down Expand Up @@ -7369,6 +7416,6 @@ Maximize Active Pane</string>
<key>findMode_iTerm</key>
<integer>0</integer>
<key>iTerm Version</key>
<string>3.3.9</string>
<string>3.3.12</string>
</dict>
</plist>

0 comments on commit e57e97f

Please sign in to comment.