News for hackers. Stuff that matters.
Re:Show HN: Teleport: Simple command line app tutorial writt... by jastanton on Thursday December 22, 2016 @03:58PM (#13240343)
A trick I commonly use is:

    cd -
Which goes back to the previous directly I was just on. They have the same thing for git as well:

    git checkout -

it's quite handy for switching back and forth between branches or directories!
Re:Show HN: Teleport: Simple command line app tutorial writt... by Fnoord on Saturday December 24, 2016 @05:57PM (#13251972)
I was using $OLDPWD and your solution is much shorter, cheers. Both also work in my shell, Fish. Perhaps obvious, but it is also possible to use cd - twice to get back to orig.
Re:Show HN: Teleport: Simple command line app tutorial writt... by gbersac on Thursday December 22, 2016 @06:22PM (#13241357)
Thanks for gi checkout -. I am currently using git checkout @{-1} which does the same thing...in a more verbose way.
Re:Show HN: Teleport: Simple command line app tutorial writt... by epidemian on Thursday December 22, 2016 @10:23PM (#13242576)
I recently learned that this trick also works with merge. `git merge -` merges the last branch you were on onto the current one. So far i've found it very useful :)