TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Most engineers have Git aliases; what are yours?

3 点作者 gcmeplz大约 2 个月前

4 条评论

LinuxBender大约 2 个月前
I have not used this in a while but here is an old function from &#x2F;etc&#x2F;profile.d&#x2F;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&#x27;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 &quot;2&quot; git config --global pack.windowMemory &quot;100m&quot; git config --global pack.packSizeLimit &quot;100m&quot; export GIT_HTTP_MAX_REQUEST_BUFFER=100M git config --global ssh.postBuffer 1000000000 git config --global http.postBuffer 1000000000 # echo &#x27;*.zip -delta&#x27; &gt; .gitattributes # echo &#x27;*.jpg -delta&#x27; &gt;&gt; .gitattributes # echo &#x27;*.bin binary -delta&#x27; &gt;&gt; .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>
评论 #43483654 未加载
metadat大约 2 个月前
.bashrc:<p><pre><code> alias g=&#x27;git&#x27; </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&#x27;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:&#x2F;&#x2F;github.com&#x2F;jj-vcs&#x2F;jj" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jj-vcs&#x2F;jj</a>
gregjor大约 2 个月前
<p><pre><code> alias lg=&#x27;lazygit&#x27;</code></pre>
JTyQZSnP3cQGa8B大约 2 个月前
&gt; Most engineers<p>I don&#x27;t believe that but I use <a href="https:&#x2F;&#x2F;github.com&#x2F;ohmyzsh&#x2F;ohmyzsh&#x2F;tree&#x2F;master&#x2F;plugins&#x2F;git" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ohmyzsh&#x2F;ohmyzsh&#x2F;tree&#x2F;master&#x2F;plugins&#x2F;git</a>
评论 #43483693 未加载