TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What timesaving Git aliases do you use?

9 pointsby glenscott1almost 6 years ago

3 comments

Chazprimealmost 6 years ago
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 未加载
gosubalmost 6 years ago
<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 未加载
mtmailalmost 6 years ago
<p><pre><code> pu = !&quot;git fetch origin -v; git fetch upstream -v; git merge upstream&#x2F;master&quot;</code></pre>