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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: What timesaving Git aliases do you use?

9 点作者 glenscott1将近 6 年前

3 条评论

Chazprime将近 6 年前
One that I find myself using probably more than I should is <i></i>undo<i></i>:<p><pre><code> # undo the last commit undo = reset --soft HEAD^ redo = reset &#x27;HEAD@{1}&#x27; </code></pre> Another is a quick update method for repos that I&#x27;m not contributing to, but might be dirty:<p><pre><code> up = !git fetch &amp;&amp; git rebase --autostash FETCH_HEAD </code></pre> And for those times I forget those aliases I don&#x27;t use as often:<p><pre><code> # list aliases la = &quot;!git config -l | grep alias | cut -c 7-&quot;</code></pre>
评论 #20357948 未加载
gosub将近 6 年前
<p><pre><code> lol = log --decorate --pretty=oneline --abbrev-commit auto = !git add --all &amp;&amp; git commit -m \&quot;AUTOCOMMIT $(date)\&quot; todo = grep TODO</code></pre>
评论 #20343424 未加载
mtmail将近 6 年前
<p><pre><code> pu = !&quot;git fetch origin -v; git fetch upstream -v; git merge upstream&#x2F;master&quot;</code></pre>