Command-Line Archive

Here’s a super quick one-liner to copy the current branch’s PR URL to your clipboard (for posting into Slack, tickets, etc.) $ gh pr view --json url --jq .url | <pbcopy | xclip -sel c> Remember to replace the copy command with your platform’s specific command. This would also make a good shell alias. Also, also, I might try setting up Clipboard for multi-platform goodness. Happy PR-ing! – Chris

git Command-Line

Here’s a quick trick I’ve been using for a while, but have found that not many others know about it. It’s a way to grab the arguments from the last command you executed. Command line expansion allows you to do many things, but today we’ll focus on just argument expansion. First to simply repeat the last command with !!. This is most helpful when needing to prefix a command; with something like sudo or bundle exec.

Command-Line

Image

Christopher R Marshall

@codegoalie

Enjoys programming web applications; especially in Go and Ruby. Also enjoys playing ice hockey as a goalie and playing the guitar.

Categories