Live data from Hacker News

Ask HN: What timesaving Git aliases do you use?

news.ycombinator.com

1–6 of 6 posts

Re: Ask HN: What timesaving Git aliases do you use?

#3
One that I find myself using probably more than I should is undo:

  # undo the last commit
  undo = reset --soft HEAD^
  redo = reset 'HEAD@{1}'
Another is a quick update method for repos that I'm not contributing to, but might be dirty:

  up = !git fetch && git rebase --autostash FETCH_HEAD

And for those times I forget those aliases I don't use as often:

  # list aliases 
  la = "!git config -l | grep alias | cut -c 7-"

Re: Ask HN: What timesaving Git aliases do you use?

#6

One that I find myself using probably more than I should is undo : # undo the last commit undo = reset --soft HEAD^ redo = reset 'HEAD@{1}' Another is a quick update method for repos that I'm not contributing to, but might be dirty: up = !git fetch && git rebase --autostash FETCH_HEAD And for those times I forget those aliases I don't use as often: # list aliases la = "!git config -l | grep alias | cut -c 7-"

> And for those times I forget those aliases I don't use as often:

`git --list-cmds=alias` is a builtin to do this, although the list-cmds option is listed as potentially likely to change.