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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

My .gitconfig File Dissected

49 点作者 KiranRao011 个月前

10 条评论

disintegrator11 个月前
One git life hack I adopted is to sign my commits with an SSH key that is stored in 1Password. Anytime a tool like git or vs code (with git under the hood) wants to sign commits, fetch/pull/push a remote, or clone a repo I get a nice pop up from 1P which prompts for TouchID on my macbook. My SSH keys don't not live on my machine as a result. This also works with SSH agent forwarding if you develop inside a VM or remote machine.
评论 #40821889 未加载
评论 #40828440 未加载
评论 #40817858 未加载
评论 #40811564 未加载
wizerno11 个月前
Julia Evans blog post [1] on the same topic, contains some more useful options.<p>[1] <a href="https:&#x2F;&#x2F;jvns.ca&#x2F;blog&#x2F;2024&#x2F;02&#x2F;16&#x2F;popular-git-config-options&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jvns.ca&#x2F;blog&#x2F;2024&#x2F;02&#x2F;16&#x2F;popular-git-config-options&#x2F;</a>
joshka11 个月前
I&#x27;m generally addicted to the oh-my-zsh git plugin aliases[1]. Mostly gswm (git switch main), gswc (git switch --create), gpf (git push --force-with-lease), gcam (git commit all --message), gcan! (git commit all --amend --no-edit), grbm (git rebase main), grbc (git rebase --continue), grba (git rebase --abort)<p>gwip (git add -A; git rm $(git ls-files --deleted) 2&gt; &#x2F;dev&#x2F;null; git commit --no-verify --no-gpg-sign --message &quot;--wip-- [skip ci]&quot;) is kinda useful when I want an actual commit before I change branches to do something else (I use this more often than stashing.<p>I also am a fan of git-brv from git extras (list branches verbose sorted by date - with the option to sort reverse so the last modified branch is the last one on your terminal)<p>And also git-trim - clean up merged branches<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;ohmyzsh&#x2F;ohmyzsh&#x2F;tree&#x2F;master&#x2F;plugins&#x2F;git">https:&#x2F;&#x2F;github.com&#x2F;ohmyzsh&#x2F;ohmyzsh&#x2F;tree&#x2F;master&#x2F;plugins&#x2F;git</a>
dennis-tra11 个月前
I’d like to add<p><pre><code> please = push —-force-with-lease </code></pre> for rebase-heavy workflows
ribasushi11 个月前
Cool stuff, thanks for sharing. I strongly recommend you add `rerere.enabled true` (makes `git pull --rebase` life easier)
评论 #40809868 未加载
suralind11 个月前
Really cool, here&#x27;s mine [0] that&#x27;s slightly longer. I also have a bunch of other stuff that you may like.<p>I also have a few handy aliases for commands I never remember [1]. Don&#x27;t need to have shortcuts like `git co` and others, because I use CMD + R with fzf to find what I need.<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;artuross&#x2F;dotfiles&#x2F;blob&#x2F;main&#x2F;home&#x2F;dot_config&#x2F;git&#x2F;config">https:&#x2F;&#x2F;github.com&#x2F;artuross&#x2F;dotfiles&#x2F;blob&#x2F;main&#x2F;home&#x2F;dot_conf...</a><p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;artuross&#x2F;dotfiles&#x2F;blob&#x2F;main&#x2F;home&#x2F;dot_config&#x2F;git&#x2F;includes&#x2F;aliases">https:&#x2F;&#x2F;github.com&#x2F;artuross&#x2F;dotfiles&#x2F;blob&#x2F;main&#x2F;home&#x2F;dot_conf...</a>
评论 #40817226 未加载
pajko11 个月前
Should have a setting for autocrlf and safecrlf to avoid shooting yourself in the foot while copying the config between platforms.
GauntletWizard11 个月前
There&#x27;s a bug in here: some git git commands will fail if you are in a subdirectory; i.e. git git add foo, because the behavior of ! Is to run those from the git root. My solution is:<p><pre><code> git = !cd -- ${GIT_PREFIX:-.} &amp;&amp; git</code></pre>
Am4TIfIsER0ppos11 个月前
If you want an interactive commit graph, among other features, look at tig <a href="https:&#x2F;&#x2F;jonas.github.io&#x2F;tig&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jonas.github.io&#x2F;tig&#x2F;</a>
fp6411 个月前
Nice to see other people carrying on with ci and co aliases as well. I don’t really remember, co goes back to cvs no? ci as well I think?