The final example `yank -- xsel -b` is probably the most directly useful for me, but it still doesn't solve the following problem which irritates me to all hell:
$ git push
fatal: The current branch new has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin new
Is there any sane way to copy the perfectly formatted `git push -u` command shown above without resorting to the following eval, which doesn't alias nicely? $(git push 2>&1 | grep git)
I think “thefuck” handles this case really well: https://github.com/nvbn/thefuck