File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,9 +10,16 @@ tower = !"gittower ."
1010# Snippets #
1111# ##############################################################################
1212
13+ # Get the git repository root path
14+ root = "rev-parse --show-toplevel"
15+
1316# Give up changes made
1417discard = "checkout --"
1518
19+ # Put staged back to unstaged
20+ unadd = "reset HEAD"
21+ unstage = "reset HEAD"
22+
1623# Tear down the most recent commit and keep changes
1724uncommit = "reset --soft HEAD~1"
1825
@@ -28,6 +35,18 @@ main-branch = !"git symbolic-ref refs/remotes/origin/HEAD | cut -d'/' -f4"
2835# https://docs.gitignore.io/install/command-line
2936gen-ignore = " ! gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ; }; gi "
3037
38+ # Assume/unassume unchanged files
39+ ignore = "update-index --assume-unchanged"
40+ unignore = "update-index --no-assume-unchanged"
41+ ignored = "ls-files -v | grep '^[[:lower:]]'"
42+
43+ # Prune everything that is unreachable
44+ pruner = ! " git prune --expire=now; git reflog expire --expire-unreachable=now --rewrite --all "
45+
46+ # Repack a repo the way Linus recommends
47+ # It does the equivalent of `git gc --aggressive` but done *properly*
48+ repacker = repack -a -d -f --depth=300 --window=300 --window-memory=1g
49+
3150# ##############################################################################
3251# Commands #
3352# ##############################################################################
You can’t perform that action at this time.
0 commit comments