I have not used this in a while but here is an old function from /etc/profile.d/functions.sh on Alpine that I used to tame some unwieldy .git folders in the past. No idea if any of it has been deprecated. It's like one big monster alias. Nowadays I instead just clone a repo to a ramdisk, purge the .git folder and then rsync it to my hoarded stash of git repos.<p><pre><code> function gitgc()
{
git config --global core.compression 6
git config --global core.loosecompression 6
git config --global pack.compression 6
git config --global core.autocrlf input
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.br branch
git config --global branch.autosetuprebase always
git config --global pack.threads "2"
git config --global pack.windowMemory "100m"
git config --global pack.packSizeLimit "100m"
export GIT_HTTP_MAX_REQUEST_BUFFER=100M
git config --global ssh.postBuffer 1000000000
git config --global http.postBuffer 1000000000
# echo '*.zip -delta' > .gitattributes
# echo '*.jpg -delta' >> .gitattributes
# echo '*.bin binary -delta' >> .gitattributes
git fsck --full --unreachable;
git repack -a -d -F --depth=1 --window=10;
git reflog expire --all --expire=now --expire-unreachable=now;
git repack -a -d -F --depth=1 --window=10;
git gc --prune=now --aggressive;
git fsck --full --unreachable;
}</code></pre>
.bashrc:<p><pre><code> alias g='git'
</code></pre>
.gitconfig:<p>Tons of aliases, but most often used are:<p><pre><code> a = add
amend = commit --amend
b = branch
co = checkout
po = pull origin
fa = fetch --all
reb = rebate
reba = rebase --abort
rebm = rebase master
unstage = git rm --cached
</code></pre>
As TFA demonstrates, it's also possible to alias full-blown shell commands and even multiple shell (or git) commands, which is powerful.<p>Someday I would like to give jj a real try, too.<p><a href="https://github.com/jj-vcs/jj" rel="nofollow">https://github.com/jj-vcs/jj</a>
> Most engineers<p>I don't believe that but I use <a href="https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git" rel="nofollow">https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/git</a>