Skip to content

Commit 5d12aa9

Browse files
committed
✨ feat: Add more git alias
1 parent c0236ef commit 5d12aa9

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

pkg/git/alias.gitconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff 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
1417
discard = "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
1724
uncommit = "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
2936
gen-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
###############################################################################

0 commit comments

Comments
 (0)