@sebastienrousseau/dotfiles 0.2.464 → 0.2.466

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/LICENSE +20 -17
  2. package/README.md +210 -382
  3. package/dist/Makefile +2 -2
  4. package/dist/bin/constants.d.ts +2 -2
  5. package/dist/bin/constants.d.ts.map +1 -1
  6. package/dist/bin/constants.js +1 -1
  7. package/dist/bin/constants.js.map +1 -1
  8. package/dist/filesizes.txt +170 -144
  9. package/dist/lib/README.md +6 -1
  10. package/dist/lib/aliases/README.md +51 -0
  11. package/dist/lib/aliases/archives/README.md +39 -67
  12. package/dist/lib/aliases/archives/archives.aliases.sh +128 -60
  13. package/dist/lib/aliases/cd/README.md +26 -9
  14. package/dist/lib/aliases/cd/cd.aliases.sh +1 -4
  15. package/dist/lib/aliases/chmod/README.md +48 -13
  16. package/dist/lib/aliases/chmod/chmod.aliases.sh +1 -1
  17. package/dist/lib/aliases/clear/README.md +33 -38
  18. package/dist/lib/aliases/clear/clear.aliases.sh +35 -33
  19. package/dist/lib/aliases/configuration/README.md +26 -37
  20. package/dist/lib/aliases/configuration/configuration.aliases.sh +40 -36
  21. package/dist/lib/aliases/default/README.md +26 -52
  22. package/dist/lib/aliases/default/default.aliases.sh +105 -44
  23. package/dist/lib/aliases/dig/README.md +23 -40
  24. package/dist/lib/aliases/dig/dig.aliases.sh +26 -29
  25. package/dist/lib/aliases/disk-usage/README.md +32 -0
  26. package/dist/lib/aliases/disk-usage/du.aliases.sh +84 -0
  27. package/dist/lib/aliases/editor/README.md +35 -33
  28. package/dist/lib/aliases/editor/editor.aliases.sh +13 -39
  29. package/dist/lib/aliases/find/README.md +42 -29
  30. package/dist/lib/aliases/find/find.aliases.sh +52 -26
  31. package/dist/lib/aliases/gcloud/README.md +59 -148
  32. package/dist/lib/aliases/gcloud/gcloud.aliases.sh +327 -138
  33. package/dist/lib/aliases/git/README.md +149 -0
  34. package/dist/lib/aliases/git/git.aliases.sh +535 -131
  35. package/dist/lib/aliases/gnu/README.md +85 -0
  36. package/dist/lib/aliases/gnu/gnucoreutils-aliases.sh +143 -109
  37. package/dist/lib/aliases/heroku/README.md +426 -0
  38. package/dist/lib/aliases/heroku/heroku.aliases.sh +1047 -288
  39. package/dist/lib/aliases/interactive/README.md +43 -0
  40. package/dist/lib/aliases/interactive/interactive.aliases.sh +48 -9
  41. package/dist/lib/aliases/jekyll/README.md +37 -0
  42. package/dist/lib/aliases/jekyll/jekyll.aliases.sh +49 -10
  43. package/dist/lib/aliases/list/README.md +38 -0
  44. package/dist/lib/aliases/list/list.aliases.sh +81 -30
  45. package/dist/lib/aliases/macOS/README.md +38 -0
  46. package/dist/lib/aliases/macOS/macos.aliases.sh +65 -0
  47. package/dist/lib/aliases/make/README.md +28 -0
  48. package/dist/lib/aliases/make/make.aliases.sh +30 -10
  49. package/dist/lib/aliases/mkdir/README.md +26 -0
  50. package/dist/lib/aliases/mkdir/mkdir.aliases.sh +24 -8
  51. package/dist/lib/aliases/npm/README.md +37 -0
  52. package/dist/lib/aliases/npm/npm.aliases.sh +54 -17
  53. package/dist/lib/aliases/permission/README.md +43 -0
  54. package/dist/lib/aliases/permission/permission.aliases.sh +73 -0
  55. package/dist/lib/aliases/pnpm/README.md +49 -0
  56. package/dist/lib/aliases/pnpm/pnpm.aliases.sh +70 -36
  57. package/dist/lib/aliases/ps/README.md +25 -0
  58. package/dist/lib/aliases/ps/ps.aliases.sh +14 -6
  59. package/dist/lib/aliases/rsync/README.md +21 -0
  60. package/dist/lib/aliases/rsync/rsync.aliases.sh +10 -4
  61. package/dist/lib/aliases/rust/README.md +57 -0
  62. package/dist/lib/aliases/rust/rust.aliases.sh +116 -39
  63. package/dist/lib/aliases/subversion/README.md +62 -0
  64. package/dist/lib/aliases/subversion/subversion.aliases.sh +4 -3
  65. package/dist/lib/aliases/sudo/README.md +23 -0
  66. package/dist/lib/aliases/sudo/sudo.aliases.sh +15 -6
  67. package/dist/lib/aliases/tmux/README.md +27 -0
  68. package/dist/lib/aliases/tmux/tmux.aliases.sh +29 -10
  69. package/dist/lib/aliases/update/README.md +34 -0
  70. package/dist/lib/aliases/update/update.aliases.sh +57 -26
  71. package/dist/lib/aliases/uuid/README.md +20 -0
  72. package/dist/lib/aliases/uuid/uuid.aliases.sh +13 -4
  73. package/dist/lib/aliases/wget/README.md +23 -0
  74. package/dist/lib/aliases/wget/wget.aliases.sh +15 -6
  75. package/dist/lib/aliases.sh +4 -3
  76. package/dist/lib/configurations/README.md +13 -2
  77. package/dist/lib/configurations/bash/bashrc +4 -3
  78. package/dist/lib/configurations/curl/curlrc +2 -2
  79. package/dist/lib/configurations/default/color.sh +3 -2
  80. package/dist/lib/configurations/default/constants.sh +4 -3
  81. package/dist/lib/configurations/default/editor.sh +3 -2
  82. package/dist/lib/configurations/default/prompt.sh +3 -2
  83. package/dist/lib/configurations/input/inputrc +2 -2
  84. package/dist/lib/configurations/nano/nanorc +2 -2
  85. package/dist/lib/configurations/profile/profile +2 -2
  86. package/dist/lib/configurations/tmux/default +2 -2
  87. package/dist/lib/configurations/tmux/display +6 -2
  88. package/dist/lib/configurations/tmux/linux +2 -2
  89. package/dist/lib/configurations/tmux/navigation +2 -2
  90. package/dist/lib/configurations/tmux/panes +2 -2
  91. package/dist/lib/configurations/tmux/theme +3 -3
  92. package/dist/lib/configurations/tmux/tmux +2 -2
  93. package/dist/lib/configurations/tmux/vi +2 -2
  94. package/dist/lib/configurations/vim/vimrc +1 -1
  95. package/dist/lib/configurations/wget/wgetrc +2 -2
  96. package/dist/lib/configurations/zsh/zshrc +2 -2
  97. package/dist/lib/configurations.sh +4 -3
  98. package/dist/lib/functions/README.md +73 -2
  99. package/dist/lib/functions/cdls.sh +3 -2
  100. package/dist/lib/functions/curlheader.sh +3 -2
  101. package/dist/lib/functions/curlstatus.sh +17 -0
  102. package/dist/lib/functions/curltime.sh +4 -3
  103. package/dist/lib/functions/encode64.sh +3 -2
  104. package/dist/lib/functions/environment.sh +3 -2
  105. package/dist/lib/functions/extract.sh +3 -2
  106. package/dist/lib/functions/filehead.sh +1 -1
  107. package/dist/lib/functions/freespace.sh +21 -0
  108. package/dist/lib/functions/genpwd.sh +33 -7
  109. package/dist/lib/functions/goto.sh +3 -2
  110. package/dist/lib/functions/hidehiddenfiles.sh +3 -2
  111. package/dist/lib/functions/hostinfo.sh +3 -2
  112. package/dist/lib/functions/hstats.sh +3 -2
  113. package/dist/lib/functions/httpdebug.sh +3 -2
  114. package/dist/lib/functions/keygen.sh +20 -13
  115. package/dist/lib/functions/last.sh +3 -2
  116. package/dist/lib/functions/logout.sh +3 -2
  117. package/dist/lib/functions/lowercase.sh +3 -2
  118. package/dist/lib/functions/matrix.sh +15 -14
  119. package/dist/lib/functions/mount_read_only.sh +3 -2
  120. package/dist/lib/functions/myproc.sh +4 -3
  121. package/dist/lib/functions/prependpath.sh +3 -2
  122. package/dist/lib/functions/ql.sh +3 -2
  123. package/dist/lib/functions/rd.sh +3 -2
  124. package/dist/lib/functions/remove_disk.sh +3 -2
  125. package/dist/lib/functions/ren.sh +3 -2
  126. package/dist/lib/functions/showhiddenfiles.sh +3 -2
  127. package/dist/lib/functions/size.sh +3 -2
  128. package/dist/lib/functions/stopwatch.sh +4 -3
  129. package/dist/lib/functions/uppercase.sh +3 -2
  130. package/dist/lib/functions/view-source.sh +3 -2
  131. package/dist/lib/functions/vscode.sh +3 -2
  132. package/dist/lib/functions/whoisport.sh +3 -2
  133. package/dist/lib/functions/zipf.sh +3 -2
  134. package/dist/lib/functions.sh +4 -3
  135. package/dist/lib/history.sh +4 -4
  136. package/dist/lib/paths/ant/ant.paths.sh +3 -2
  137. package/dist/lib/paths/default/default.paths.sh +3 -2
  138. package/dist/lib/paths/homebrew/homebrew.paths.sh +3 -2
  139. package/dist/lib/paths/java/java.paths.sh +3 -2
  140. package/dist/lib/paths/maven/maven.paths.sh +3 -2
  141. package/dist/lib/paths/node/node.paths.sh +3 -2
  142. package/dist/lib/paths/nvm/nvm.paths.sh +3 -2
  143. package/dist/lib/paths/pnpm/pnpm.paths.sh +3 -2
  144. package/dist/lib/paths/python/python.paths.sh +3 -2
  145. package/dist/lib/paths/ruby/ruby.paths.sh +3 -2
  146. package/dist/lib/paths/tmux/tmux.paths.sh +3 -2
  147. package/dist/lib/paths.sh +4 -3
  148. package/dist/scripts/backup.sh +3 -2
  149. package/dist/scripts/banner.sh +3 -2
  150. package/dist/scripts/build.sh +3 -2
  151. package/dist/scripts/clean.sh +3 -2
  152. package/dist/scripts/compile.sh +3 -2
  153. package/dist/scripts/copy.sh +3 -2
  154. package/dist/scripts/dotfiles.sh +3 -2
  155. package/dist/scripts/download.sh +3 -2
  156. package/dist/scripts/help.sh +3 -2
  157. package/dist/scripts/ssh.sh +3 -2
  158. package/dist/scripts/unpack.sh +3 -2
  159. package/package.json +7 -7
  160. package/dist/lib/aliases/du/README.md +0 -35
  161. package/dist/lib/aliases/du/du.aliases.sh +0 -37
  162. package/dist/lib/functions/changediskpwd.tmp +0 -19
  163. package/dist/lib/functions/code.tmp +0 -18
  164. package/dist/lib/functions/countdown.tmp +0 -34
  165. package/dist/lib/functions/headers.tmp +0 -4
  166. package/dist/lib/functions/history-all.tmp +0 -8
  167. package/dist/lib/functions/macos.sh +0 -47
  168. package/dist/lib/functions/mcd.tmp +0 -19
  169. package/dist/lib/functions/print.tmp +0 -14
  170. package/dist/lib/functions/rm.tmp +0 -14
  171. package/dist/lib/functions/rps.tmp +0 -104
  172. package/dist/lib/functions/trash.tmp +0 -14
  173. package/dist/lib/functions/tree.tmp +0 -14
  174. package/dist/lib/functions/uuidgen.tmp +0 -28
@@ -1,140 +1,544 @@
1
1
  #!/usr/bin/env bash
2
- # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.464) - https://dotfiles.io
3
- # Made with in London, UK by @sebastienrousseau
2
+
3
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.466) - <https://dotfiles.io>
4
+ # Made with ♥ in London, UK by @wwdseb
4
5
  # Copyright (c) 2015-2023. All rights reserved
5
6
  # License: MIT
6
7
 
7
8
  # 🅶🅸🆃 🅰🅻🅸🅰🆂🅴🆂 - Git aliases.
9
+ #
10
+ # Sections:
11
+ #
12
+ # 1.0 Git Core aliases.
13
+ # 1.1 Work on the current change.
14
+ # 1.2 Start a working area.
15
+ # 1.3 Examine the history and state.
16
+ # 1.4 List, create, or delete branches.
17
+ # 1.5 Collaborate.
18
+ # 1.6 Record changes to the repository.
19
+ # 1.7 Show changes between commits, commit and working tree, etc.
20
+ # 1.8 Show commit logs.
21
+ # 1.9 Switch branches or restore working tree files.
22
+ # 2.0 Update remote refs along with associated objects.
23
+ # 2.1 Aliases to manage set of tracked repositories.
24
+ # 2.2 Aliases to revert some existing commits.
25
+ # 2.3 Aliases to initialize, update or inspect submodules.
26
+ # 2.4 Aliases to show the working tree status.
27
+ # 2.5 Aliases to create, list, delete or verify a tag object
28
+ # signed with GPG.
29
+ # 2.6 Aliases to show various types of objects.
30
+ # 2.7 Aliases to reset current HEAD to the specified state.
31
+ # 2.8 Aliases to pick out and massage parameters.
32
+ # 2.9 Aliases to remove files from the working tree and from the
33
+ # index.
34
+ # 3.0 Aliases to show what revision and author last modified each
35
+ # line of a file.
36
+ # 3.1 Aliases to get and set repository or global options.
37
+ #
38
+ ## --------------------------------------------------------------------
39
+ ## 1.0 Git Core aliases
40
+ ## --------------------------------------------------------------------
41
+
42
+ ## --------------------------------------------------------------------
43
+ ## 1.1 Aliases to work on the current change
44
+ ## --------------------------------------------------------------------
45
+
46
+ if command -v git &>/dev/null; then
47
+
48
+ # Short-form git commands.
49
+ alias g='git'
50
+
51
+ # Add file contents to the index.
52
+ alias ga='git add'
53
+
54
+ # Add file contents and update the index not only where the
55
+ # working tree has a file matching <pathspec> but also where the
56
+ # index already has an entry.
57
+ alias gaa='git add --all'
58
+
59
+ # Add current directory file contents to the index.
60
+ alias gad='git add .'
61
+
62
+ # Add file contents and update the index just where it already has an
63
+ # entry matching <pathspec>.
64
+ alias gau='git add --update'
65
+
66
+ # Undo to last commit.
67
+ alias gco='git checkout'
68
+
69
+ # Discard changes in a (list of) file(s) in working tree
70
+ alias gdis='checkout --'
71
+
72
+ # Move or rename a file, a directory, or a symlink.
73
+ alias gmv='git mv'
74
+
75
+ # Restore working tree files.
76
+ alias grs='git restore'
77
+
78
+ # Remove files from the working tree and from the index.
79
+ alias grm='git remove'
80
+
81
+ # Initialize and modify the sparse-checkout.
82
+ alias gsc='git sparse-checkout'
83
+
84
+ ## ------------------------------------------------------------------
85
+ ## 1.2 Aliases to start a working area
86
+ ## ------------------------------------------------------------------
87
+
88
+ # Clone a repository into a new directory.
89
+ alias gcl='git clone'
90
+
91
+ # Create an empty Git repository or reinitialize an existing one.
92
+ alias gin='git init'
93
+
94
+ ## ------------------------------------------------------------------
95
+ ## 1.3 Aliases to examine the history and state
96
+ ## ------------------------------------------------------------------
97
+
98
+ # Use binary search to find the commit that introduced a bug.
99
+ alias gbs='git bisect'
100
+
101
+ # Show changes between commits, commit and working tree, etc.
102
+ alias gd='git diff'
103
+
104
+ # Print lines matching a pattern.
105
+ alias gg='git grep'
106
+
107
+ # Show commit logs this month.
108
+ alias gl='git log --since="last month" --oneline'
109
+
110
+ # Show commit logs and Draw a text-based graphical representation of
111
+ # the commit history on the left hand side of the output.
112
+ alias glg='git log --oneline --graph --full-history --all --color --decorate'
113
+
114
+ # Show various types of objects.
115
+ alias gs='git show'
116
+
117
+ ## ------------------------------------------------------------------
118
+ ## 1.4 Aliases to list, create, or delete branches
119
+ ## ------------------------------------------------------------------
120
+
121
+ # gb: Create a branch.
122
+ alias gb='git branch'
123
+
124
+ # gbd: Delete a branch.
125
+ alias gbd='git branch -d'
126
+
127
+ # gbl: List branches.
128
+ alias gbl='git branch -l'
129
+
130
+ # gbr: List the remote-tracking branches.
131
+ alias gbr='git branch -r'
132
+
133
+ # gbrd: Delete the remote-tracking branches.
134
+ alias gbrd='git branch -d -r'
135
+
136
+ # Print a list of branches and their commits.
137
+ alias gbrsb='git show-branch'
138
+
139
+ # gct: Record changes to the repository.
140
+ alias gct='git commit'
141
+
142
+ # gmg: Join two or more development histories together.
143
+ alias gmg='git merge'
144
+
145
+ # grb: Reapply commits on top of another base tip.
146
+ alias grb='git rebase'
147
+
148
+ # grs: Reset current HEAD to the specified state.
149
+ alias grs='git reset'
150
+
151
+ # gswb: Switch branches.
152
+ alias gswb='git switch'
153
+
154
+ ## ------------------------------------------------------------------
155
+ ## 1.5 Aliases to collaborate
156
+ ## ------------------------------------------------------------------
157
+
158
+ # Create an empty Git repository or reinitialize an existing one.
159
+ alias gi='git init'
8
160
 
9
- if command -v 'git' >/dev/null; then
10
- alias g='git' # g: Short-form git commands.
11
- alias ga='git add' # ga: Add file contents to the index.
12
- alias gaa='git add --all' # gaa: Add file contents and update the index not only where the working tree has a file matching <pathspec> but also where the index already has an entry.
13
- alias gad='git add .' # gad: Add current directory file contents to the index.
14
- alias gau='git add --update' # gau: Add file contents and update the index just where it already has an entry matching <pathspec>.
15
- alias gco='git checkout' # gco: Undo to last commit.
16
- alias gdis='checkout --' # gdis: Discard changes in a (list of) file(s) in working tree
17
- alias gmv='git mv' # gmv: Move or rename a file, a directory, or a symlink.
18
- alias grs='git restore' # grs: Restore working tree files.
19
- alias grm='git remove' # grm: Remove files from the working tree and from the index.
20
- alias gsc='git sparse-checkout' # gsc: Initialize and modify the sparse-checkout.
21
- alias gcl='git clone' # gcl: Clone a repository into a new directory.
22
- alias gin='git init' # gin: Create an empty Git repository or reinitialize an existing one.
23
- alias gbs='git bisect' # gbs: Use binary search to find the commit that introduced a bug.
24
- alias gd='git diff' # gd: Show changes between commits, commit and working tree, etc.
25
- alias gg='git grep' # gg: Print lines matching a pattern.
26
- alias gl='git log --since="last month" --oneline' # gl: Show commit logs this month.
27
- alias glg='git log --oneline --graph --full-history --all --color --decorate' # glg: Show commit logs and Draw a text-based graphical representation of the commit history on the left hand side of the output.
28
- alias gs='git show' # Show various types of objects.
29
- alias gb='git branch' # gb: Create a branch.
30
- alias gbd='git branch -d' # gbd: Delete a branch.
31
- alias gbl='git branch -l' # gbl: List branches.
32
- alias gbr='git branch -r' # gbr: List the remote-tracking branches.
33
- alias gbrd='git branch -d -r' # gbrd: Delete the remote-tracking branches.
34
- alias gbrsb='git show-branch' # Print a list of branches and their commits.
35
- alias gct='git commit' # gct: Record changes to the repository.
36
- alias gmg='git merge' # gmg: Join two or more development histories together.
37
- alias grb='git rebase' # grb: Reapply commits on top of another base tip.
38
- alias grs='git reset' # grs: Reset current HEAD to the specified state.
39
- alias gswb='git switch' # gswb: Switch branches.
40
- alias gi='git init' # gi: Create an empty Git repository or reinitialize an existing one.
41
- alias gf='git fetch' # gf: Download objects and refs from another repository.
42
- alias gp='git pull' # gp: Fetch from and integrate with another repository or a local branch.
43
- alias gph='git push' # Update remote refs along with associated objects.
44
- alias gc='git commit -a' # Commit command to automatically "add" changes from all known files.
45
- alias gca='git commit --amend' # Amend the tip of the current branch rather than creating a new commit.
46
- alias gcall='git add -A && git commit -av' # Commit all changes.
47
- alias gcam='git commit --amend --message' # Amend the tip of the current branch, and edit the message.
48
- alias gcane='git commit --amend --no-edit' # Amend the tip of the current branch, and do not edit the message.
49
- alias gcint='git commit --interactive' # Commit interactive.
50
- alias gcm='git commit --message ' # Commit with a message.
51
- alias gd='git diff' # Show changes between the working tree and the index or a tree.
52
- alias gdch='git diff --name-status' # Show only names and status of changed files.
53
- alias gdh='git diff HEAD' # Show all changes of tracked files which are present in working directory and staging area.
54
- alias gdstaged='git diff --staged' # Show changes to files in the "staged" area.
55
- alias gdcached='git diff --cached' # Shows the changes between the index and the HEAD (which is the last commit on this branch).
56
- alias gdstat='git diff --stat --ignore-space-change -r' # Generate a diffstat.
57
- alias glc='git log --oneline --reverse' # Show log of changes, most recent first.
58
- alias gld='git log --since=1-day-ago' # Show the log of the recent day.
59
- alias gldc='git log -1 --date-order --format=%cI' # Show the date of the latest commit, in strict ISO 8601 format.
60
- alias gldl='git log --date=local' # Show log with dates in our local timezone.
61
- alias glf='git log ORIG_HEAD.. --stat --no-merges' # Show log of new commits after you fetched, with stats, excluding merges.
62
- alias glfd='!"git log --date-order --format=%cI | tail -1"' # Show the date of the earliest commit, in strict ISO 8601 format.
63
- alias glfh='git log --graph --full-history --all --color' # Visualization of branch topology.
64
- alias glg='git log --graph --all --oneline --decorate' # Show log as a graph.
65
- alias glh='git log --since=1-hour-ago' # Show the log of the recent hour.
66
- # Show log in our preferred format for our key performance indicators. A.k.a. `ll`.
161
+ # Download objects and refs from another repository.
162
+ alias gf='git fetch'
163
+
164
+ # Fetch from and integrate with another repository or a local branch.
165
+ alias gp='git pull'
166
+
167
+ # Update remote refs along with associated objects.
168
+ alias gph='git push'
169
+
170
+ ## ------------------------------------------------------------------
171
+ ## 1.6 Aliases to record changes to the repository
172
+ ## ------------------------------------------------------------------
173
+
174
+ # Commit command to automatically "add" changes from all known files.
175
+ alias gc='git commit -a'
176
+
177
+ # Amend the tip of the current branch rather than creating a new
178
+ # commit.
179
+ alias gca='git commit --amend'
180
+
181
+ # Commit all changes.
182
+ alias gcall='git add -A && git commit -av'
183
+
184
+ # Amend the tip of the current branch, and edit the message.
185
+ alias gcam='git commit --amend --message '
186
+
187
+ # Amend the tip of the current branch, and do not edit the message.
188
+ alias gcane='git commit --amend --no-edit'
189
+
190
+ # Commit interactive.
191
+ alias gcint='git commit --interactive'
192
+
193
+ # Commit with a message.
194
+ alias gcm='git commit --message '
195
+
196
+ ## ------------------------------------------------------------------
197
+ ## 1.7 Aliases to show changes between commits, commit and working
198
+ ## tree, etc.
199
+ ## ------------------------------------------------------------------
200
+
201
+ # Show changes between the working tree and the index or a tree.
202
+ alias gd='git diff'
203
+
204
+ # Show only names and status of changed files.
205
+ alias gdch='git diff --name-status'
206
+
207
+ # Show all changes of tracked files which are present in working
208
+ # directory and staging area.
209
+ alias gdh='git diff HEAD'
210
+
211
+ # Show changes to files in the "staged" area.
212
+ alias gdstaged='git diff --staged'
213
+
214
+ # Shows the changes between the index and the HEAD (which is the last
215
+ # commit on this branch).
216
+ alias gdcached='git diff --cached'
217
+
218
+ # Generate a diffstat.
219
+ alias gdstat='git diff --stat --ignore-space-change -r'
220
+
221
+ ## ------------------------------------------------------------------
222
+ ## 1.8 Aliases to show commit logs
223
+ ## ------------------------------------------------------------------
224
+
225
+ # Show log of changes, most recent first.
226
+ alias glc='git log --oneline --reverse'
227
+
228
+ # Show the log of the recent day.
229
+ alias gld='git log --since=1-day-ago'
230
+
231
+ # Show the date of the latest commit, in strict ISO 8601 format.
232
+ alias gldc='git log -1 --date-order --format=%cI'
233
+
234
+ # Show log with dates in our local timezone.
235
+ alias gldl='git log --date=local'
236
+
237
+ # Show log of new commits after you fetched, with stats, excluding
238
+ # merges.
239
+ alias glf='git log ORIG_HEAD.. --stat --no-merges'
240
+
241
+ # Show the date of the earliest commit, in strict ISO 8601 format.
242
+ alias glfd='!"git log --date-order --format=%cI | tail -1"'
243
+
244
+ # Visualization of branch topology.
245
+ alias glfh='git log --graph --full-history --all --color'
246
+
247
+ # Show log as a graph.
248
+ alias glg='git log --graph --all --oneline --decorate'
249
+
250
+ # Show the log of the recent hour.
251
+ alias glh='git log --since=1-hour-ago'
252
+
253
+ # Show log in our preferred format for our key performance indicators.
67
254
  alias gll='git log --graph --topo-order --date=short --abbrev-commit --decorate --all --boundary --pretty=format:"%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn]%Creset %Cblue%G?%Creset"'
68
- # Show log in our preferred format for our key performance indicators, with long items. A.k.a. `lll`.
255
+
256
+ # Show log in our preferred format for our key performance indicators,
257
+ # with long items.
69
258
  alias glll='git log --graph --topo-order --date=iso8601-strict --no-abbrev-commit --decorate --all --boundary --pretty=format:"%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn <%ce>]%Creset %Cblue%G?%Creset"'
70
- alias glm='git log --since=1-month-ago' # Show the log of the recent month.
71
- alias glmy='!git log --author $(git config user.email)' # Show the log for my own commits by my own user email.
72
- alias glw='git log --since=1-week-ago' # Show the log of the recent week.
73
- alias gly='git log --since=1-year-ago' # Show the log of the recent year.
74
- alias gclout='git clean -df && git checkout -- .' # Clean and discard changes and untracked files in working tree.
75
- alias gco='git checkout' # Switch branches or restore working tree files.
76
- alias gcb='git checkout -b' # Create a new branch named <new_branch> and start it at <start_point>.
77
- alias gcode='git checkout main && git branch --merged | xargs git branch --delete' # Delete all local branches that have been merged into the local main branch.
78
- alias gcom='git checkout main && git fetch origin --prune && git reset --hard origin/main' # Ensure local is like the main branch.
79
- alias gpb='git push --set-upstream origin $(git current-branch)' # Publish the current branch by pushing it to the remote "origin", and setting the current branch to track the upstream branch.
80
- alias gpo='git push origin' # Push local changes to the online repository.
81
- alias gpt='git push --tags' # Push local tags.
82
- alias gpoll='git push origin --all' # Push each of your local git branches to the remote repository
83
- alias gpull='git pull' # Fetch from and integrate with another repository or a local branch.
84
- alias gpullm='git pull origin master' # Pull changes from the locally stored branch origin/master and merge that to the local checked-out branch.
85
- alias gpullo='git pull origin $(git current-branch)' # Do a pull for just one branch.
86
- alias gpush='git push' # Update remote refs along with associated objects.
87
- alias gpusho='git push origin $(git current-branch)' # Do a push for just one branch.
88
- alias gpushr='git remote | xargs -I% -n1 git push %' # For each remote branch, push it.
89
- alias gunpub='git push origin :$(git current-branch)' # Unpublish the current branch by deleting the remote version of the current branch.
90
- alias gr='git remote' # Manage set of tracked repositories.
91
- alias gra='git remote add' # Add a remote named name for the repository at url.
92
- alias grall='git remote | xargs -L1 git push --all' # Push all branches to all remotes.
93
- alias grao='git remote add origin' # Add a new remote 'origin' if it doesn't exist.
94
- alias grbk='git reset --soft HEAD^' # Rollback to stage.
95
- alias grcl='git remote prune' # Deletes all stale remote-tracking branches under <name>.
96
- alias grp="git remote | xargs -I% -n1 git push %" # For each remote branch, push it.
97
- # Push all remotes. Print the url for the current repo.
98
- alias grprint="git remote -v | sed -n '/github.com.*push/{s/^[^[:space:]]\+[[:space:]]\+//;s|git@github.com:|https://github.com/|;s/\.git.*//;p}"
99
- alias grs='git show' # Gives some information about the remote <name>.
100
- alias grso='git remote show origin' # Display where the origin resides.
101
- alias gru='git remote update' # Fetch updates for a named set of remotes in the repository as defined by remotes.
102
- alias grv='git remote -v' # Shows URLs of remote repositories when listing your current remote connections.
103
- alias grev='git revert' # Undo the changes from some existing commits
104
- alias grevnc='git revert --no-commit' # Revert without autocommit; useful when you're reverting more than one commits' effect to your index in a row.
105
- alias gsm='git submodule' # Enables foreign repositories to be embedded within a dedicated subdirectory of the source tree.
106
- alias gsmi='git submodule init' # Initialize the submodules recorded in the index
107
- alias gsma='git submodule add' # Add the given repository as a submodule at the given path to the changeset to be committed next to the current project: the current project is termed the "superproject".
108
- alias gsms='git submodule sync' # Synchronizes submodules' remote URL configuration setting to the value specified in .gitmodules.
109
- alias gsmu='git submodule update' # Update the registered submodules to match what the superproject expects by cloning missing submodules, fetching missing commits in submodules and updating the working tree of the submodules.
110
- alias gsmui='git submodule update --init' # Submodule update with initialize
111
- alias gsmuir='git submodule update --init --recursive' # Submodule update with initialize and recursive; this is useful to bring a submodule fully up to date.
112
- alias gst='git status' # Show the working tree status.
113
- alias gsta='git stash save ' # Stash the changes.
114
- alias gsts='git status --short' # Status with short format instead of full details.
115
- alias gstsb='git status --short --branch' # Status with short format and showing branch and tracking info.
116
- alias gt='git tag' # See all tags.
117
- alias gtg='git tag' # Create, list, delete or verify a tag object signed with GPG.
118
- alias gtl='git describe --tags --abbrev=0' # Last tag in the current branch.
119
- alias gshow='git show' # Show various types of objects
120
- alias gshls='git show --relative --pretty=format:''' # Show list of files changed by commit.
121
- alias gshnp='git show --no-patch --pretty="tformat:%h (%s, %ad)" --date=short' # Given any git object, try to show it briefly.
122
- alias gshwho='git shortlog --summary --numbered --no-merges' # Show who contributed, in descending order by number of commits.
123
- alias grescl='git reset --hard HEAD~1 && git clean -fd' # Reset commit clean.
124
- alias gresh='git reset --hard HEAD~1' # Reset commit hard.
125
- alias gresp='git reset --hard && git clean -ffdx' # Reset pristine.
126
- alias gress='git reset --soft HEAD~1' # Reset commit.
127
- alias gresu='git reset --hard $(git upstream-branch)' # Reset to upstream.
128
- alias gtp='git rev-parse --show-toplevel' # Get the top level directory name.
129
- alias grpa='git rev-parse --abbrev-ref HEAD' # Get the current branch name.
130
- alias grm='git rm' # Remove files from the working tree and from the index.
131
- alias grmc='git rm --cached' # Unstage and remove paths only from the index.
132
- alias grmd='git ls-files -z --deleted | xargs -0 git rm' # Remove files which have been deleted.
133
- alias grmd2='git rm $(git ls-files --deleted)' # Remove files which have been deleted.
134
- alias grmds='find . -name .DS_Store -exec git rm --ignore-unmatch --cached {} +' # Remove .DS_Store from the repository.
135
- alias grmx='git ls-files -z -d | xargs -0 git rm --' # Remove for all deleted files, including those with space/quote/unprintable characters in their filename/path.
136
- alias gconfdiff='git config alias.dcolor "diff --color-words"' # Better git diff, word delimited and colorized.
137
- alias gconfl='git config --list' # List all the settings.
138
- alias gconfr='git config --local --get remote.origin.url' # Output remote origin from within a local repository.
139
- alias undopush="git push -f origin HEAD^:master" # undopush: Undo the last push.
259
+
260
+ # Show the log of the recent month.
261
+ alias glm='git log --since=1-month-ago'
262
+
263
+ # Show the log for my own commits by my own user email.
264
+ alias glmy='!git log --author $(git config user.email)'
265
+
266
+ # Show the log of the recent week.
267
+ alias glw='git log --since=1-week-ago'
268
+
269
+ # Show the log of the recent year.
270
+ alias gly='git log --since=1-year-ago'
271
+
272
+ ## ------------------------------------------------------------------
273
+ ## 1.9 Aliases to switch branches or restore working tree files
274
+ ## ------------------------------------------------------------------
275
+
276
+ # Clean and discard changes and untracked files in working tree.
277
+ alias gclout='git clean -df && git checkout -- .'
278
+
279
+ # Switch branches or restore working tree files.
280
+ alias gco='git checkout'
281
+
282
+ # Create a new branch named <new_branch> and start it at
283
+ # <start_point>.
284
+ alias gcb='git checkout -b'
285
+
286
+ # Delete all local branches that have been merged into the local main
287
+ # branch.
288
+ alias gcode='git checkout main && git branch --merged | xargs git branch --delete'
289
+
290
+ # Ensure local is like the main branch.
291
+ alias gcom='git checkout main && git fetch origin --prune && git reset --hard origin/main'
292
+
293
+ ## ------------------------------------------------------------------
294
+ ## 2.0 Aliases to update remote refs along with associated objects
295
+ ## ------------------------------------------------------------------
296
+
297
+ # Publish the current branch by pushing it to the remote "origin", and
298
+ # setting the current branch to track the upstream branch.
299
+ alias gpb='git push --set-upstream origin $(git current-branch)'
300
+
301
+ # Push local changes to the online repository.
302
+ alias gpo='git push origin'
303
+
304
+ # Push local tags.
305
+ alias gpt='git push --tags'
306
+
307
+ # Push each of your local git branches to the remote repository
308
+ alias gpoll='git push origin --all'
309
+
310
+ # Fetch from and integrate with another repository or a local branch.
311
+ alias gpull='git pull'
312
+
313
+ # Pull changes from the locally stored branch origin/master and merge
314
+ # that to the local checked-out branch.
315
+ alias gpullm='git pull origin master'
316
+
317
+ # Do a pull for just one branch.
318
+ alias gpullo='git pull origin $(git current-branch)'
319
+
320
+ # Update remote refs along with associated objects.
321
+ alias gpush='git push'
322
+
323
+ # Do a push for just one branch.
324
+ alias gpusho='git push origin $(git current-branch)'
325
+
326
+ # For each remote branch, push it.
327
+ alias gpushr='git remote | xargs -I% -n1 git push %'
328
+
329
+ # Unpublish the current branch by deleting the remote version of the
330
+ # current branch.
331
+ alias gunpub='git push origin :$(git current-branch)'
332
+
333
+ # Push current branch
334
+ # alias gpcb='git push origin "$(git branch|grep '\*'|tr -d '* \n')"'
335
+
336
+ ## ------------------------------------------------------------------
337
+ ## 2.1 Aliases to manage set of tracked repositories
338
+ ## ------------------------------------------------------------------
339
+
340
+ # Manage set of tracked repositories.
341
+ alias gr='git remote'
342
+
343
+ # Add a remote named <name> for the repository at <url>.
344
+ alias gra='git remote add'
345
+
346
+ # Push all branches to all remotes.
347
+ alias grall='git remote | xargs -L1 git push --all'
348
+
349
+ # Add a new remote 'origin' if it doesn't exist.
350
+ alias grao='git remote add origin'
351
+
352
+ # Rollback to stage.
353
+ alias grbk='git reset --soft HEAD^'
354
+
355
+ # Deletes all stale remote-tracking branches under <name>.
356
+ alias grcl='git remote prune'
357
+
358
+ # For each remote branch, push it.
359
+ alias grp="git remote | xargs -I% -n1 git push %"
360
+
361
+ # Push all remotes.
362
+ # Print the url for the current repo.
363
+ alias grprint="git remote -v | sed -n '/github.com.*push/{ s/^[^[:space:]]\+[[:space:]]\+//; s|git@github.com:|https://github.com/|; s/\.git.*//; p }'"
364
+
365
+ # Gives some information about the remote <name>.
366
+ alias grs='git show'
367
+
368
+ # Display where the origin resides.
369
+ alias grso='git remote show origin'
370
+
371
+ # Fetch updates for a named set of remotes in the repository as
372
+ # defined by remotes.
373
+ alias gru='git remote update'
374
+
375
+ # Shows URLs of remote repositories when listing your current remote
376
+ # connections.
377
+ alias grv='git remote -v'
378
+
379
+ ## ------------------------------------------------------------------
380
+ ## 2.2 Aliases to revert some existing commits
381
+ ## ------------------------------------------------------------------
382
+
383
+ # Undo the changes from some existing commits
384
+ alias grev='git revert'
385
+
386
+ # Revert without autocommit; useful when you're reverting more than
387
+ # one commits' effect to your index in a row.
388
+ alias grevnc='git revert --no-commit'
389
+
390
+ ## ------------------------------------------------------------------
391
+ ## 2.3 Aliases to initialize, update or inspect submodules
392
+ ## ------------------------------------------------------------------
393
+
394
+ # Enables foreign repositories to be embedded within a dedicated
395
+ # subdirectory of the source tree.
396
+ alias gsm='git submodule'
397
+
398
+ # Initialize the submodules recorded in the index
399
+ alias gsmi='git submodule init'
400
+
401
+ # Add the given repository as a submodule at the given path to the
402
+ # changeset to be committed next to the current project: the current
403
+ # project is termed the "superproject".
404
+ alias gsma='git submodule add'
405
+
406
+ # Synchronizes submodules' remote URL configuration setting to the
407
+ # value specified in .gitmodules.
408
+ alias gsms='git submodule sync'
409
+
410
+ # Update the registered submodules to match what the superproject
411
+ # expects by cloning missing submodules, fetching missing commits in
412
+ # submodules and updating the working tree of the submodules.
413
+ alias gsmu='git submodule update'
414
+
415
+ # Submodule update with initialize
416
+ alias gsmui='git submodule update --init'
417
+
418
+ # Submodule update with initialize and recursive; this is useful to
419
+ # bring a submodule fully up to date.
420
+ alias gsmuir='git submodule update --init --recursive'
421
+
422
+ ## ------------------------------------------------------------------
423
+ ## 2.4 Aliases to show the working tree status
424
+ ## ------------------------------------------------------------------
425
+
426
+ # Show the working tree status.
427
+ alias gst='git status'
428
+
429
+ # Stash the changes.
430
+ alias gsta='git stash save '
431
+
432
+ # Status with short format instead of full details.
433
+ alias gsts='git status --short'
434
+
435
+ # Status with short format and showing branch and tracking info.
436
+ alias gstsb='git status --short --branch'
437
+
438
+ ## ------------------------------------------------------------------
439
+ ## 2.5 Aliases to create, list, delete or verify a tag object
440
+ ## signed with GPG.
441
+ ## ------------------------------------------------------------------
442
+
443
+ # See all tags.
444
+ alias gt='git tag'
445
+
446
+ # Create, list, delete or verify a tag object signed with GPG.
447
+ alias gtg='git tag'
448
+
449
+ # Last tag in the current branch.
450
+ alias gtl='git describe --tags --abbrev=0'
451
+
452
+ ## ------------------------------------------------------------------
453
+ ## 2.6 Aliases to show various types of objects.
454
+ ## ------------------------------------------------------------------
455
+
456
+ # Show various types of objects
457
+ alias gshow='git show'
458
+
459
+ # Show list of files changed by commit.
460
+ alias gshls='git show --relative --pretty=format:'''
461
+
462
+ # Given any git object, try to show it briefly.
463
+ alias gshnp='git show --no-patch --pretty="tformat:%h (%s, %ad)" --date=short'
464
+
465
+ # Show who contributed, in descending order by number of commits.
466
+ alias gshwho='git shortlog --summary --numbered --no-merges'
467
+
468
+ ## ------------------------------------------------------------------
469
+ ## 2.7 Aliases to reset current HEAD to the specified state.
470
+ ## ------------------------------------------------------------------
471
+
472
+ # Reset commit clean.
473
+ alias grescl='git reset --hard HEAD~1 && git clean -fd'
474
+
475
+ # Reset commit hard.
476
+ alias gresh='git reset --hard HEAD~1'
477
+
478
+ # Reset pristine.
479
+ alias gresp='git reset --hard && git clean -ffdx'
480
+
481
+ # Reset commit.
482
+ alias gress='git reset --soft HEAD~1'
483
+
484
+ # Reset to upstream.
485
+ alias gresu='git reset --hard $(git upstream-branch)'
486
+
487
+ ## ------------------------------------------------------------------
488
+ ## 2.8 Aliases to pick out and massage parameters.
489
+ ## ------------------------------------------------------------------
490
+
491
+ # Get the top level directory name.
492
+ alias gtp='git rev-parse --show-toplevel'
493
+
494
+ # Get the current branch name.
495
+ alias grpa='git rev-parse --abbrev-ref HEAD'
496
+
497
+ ## ------------------------------------------------------------------
498
+ ## 2.9 Aliases to remove files from the working tree and from the
499
+ ## index.
500
+ ## ------------------------------------------------------------------
501
+
502
+ # Remove files from the working tree and from the index.
503
+ alias grm='git rm'
504
+
505
+ # Unstage and remove paths only from the index.
506
+ alias grmc='git rm --cached'
507
+
508
+ # Remove files which have been deleted.
509
+ alias grmd='git ls-files -z --deleted | xargs -0 git rm'
510
+
511
+ # Remove files which have been deleted.
512
+ alias grmd2='git rm $(git ls-files --deleted)'
513
+
514
+ # Remove .DS_Store from the repository.
515
+ alias grmds='find . -name .DS_Store -exec git rm --ignore-unmatch --cached {} +'
516
+
517
+ # Remove for all deleted files, including those with
518
+ # space/quote/unprintable characters in their filename/path.
519
+ alias grmx='git ls-files -z -d | xargs -0 git rm --'
520
+
521
+ ## ------------------------------------------------------------------
522
+ ## 3.0 Aliases to show what revision and author last modified each
523
+ ## line of a file.
524
+ ## ------------------------------------------------------------------
525
+
526
+ # Prints per-line contribution per author for a GIT repository.
527
+ # alias gblau='git ls-files | xargs -n1 git blame --line-porcelain | sed -n "s/^author //p" | sort -f | uniq -ic | sort -nr'
528
+
529
+ ## ------------------------------------------------------------------
530
+ ## 3.1 Aliases to get and set repository or global options.
531
+ ## ------------------------------------------------------------------
532
+
533
+ # Better git diff, word delimited and colorized.
534
+ alias gconfdiff='git config alias.dcolor "diff --color-words"'
535
+
536
+ # List all the settings.
537
+ alias gconfl='git config --list'
538
+
539
+ # Output remote origin from within a local repository.
540
+ alias gconfr='git config --local --get remote.origin.url'
541
+
542
+ # Undo the last push.
543
+ alias undopush="git push -f origin HEAD^:master"
140
544
  fi