Ask HN: What timesaving Git aliases do you use?

by glenscott1on 7/2/2019, 12:31 PMwith 5 comments

by Chazprimeon 7/2/2019, 2:52 PM

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-"

by gosubon 7/3/2019, 8:54 AM

    lol = log --decorate --pretty=oneline --abbrev-commit
    auto = !git add --all && git commit -m \"AUTOCOMMIT $(date)\"
    todo = grep TODO

by mtmailon 7/2/2019, 2:31 PM

    pu = !"git fetch origin -v; git fetch upstream -v; git merge upstream/master"