Skip to content

Instantly share code, notes, and snippets.

@goodtune
Last active February 17, 2017 06:13
Show Gist options
  • Save goodtune/c5c0e93905b889384469c585a1000297 to your computer and use it in GitHub Desktop.
Save goodtune/c5c0e93905b889384469c585a1000297 to your computer and use it in GitHub Desktop.
git tricks

git tricks

Things I've learned about git but don't use that often.

turn on colours

Wherever possible, use colours.

git config --global color.ui true

pull request branches

Want to be able to checkout a pull request locally?

git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"

How about the product of merging a PR? Perhaps to save yet another merge being done, and not losing the product of your CI system.

git config --global --add remote.origin.fetch "+refs/pull/*/merge:refs/remotes/origin/ci/*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment