Skip to content

Instantly share code, notes, and snippets.

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@sudodo
sudodo / how_to_get_cleared_stash_on_git
Created December 9, 2011 06:24
git stash clearを元に戻す方法
h1. 変更が消えてしまった!?その対応
せっかく実施したコードへの修正が消えてしまう、これほど開発者をがっかりさせることは無いでしょう。
Gitを使えば、消えてしまったように見える変更を復活できることがあります。
h2. 大原則
復活できる可能性があるのは、「何らかの形でGitに履歴を残してある歴史」だけです。
たとえば、以下のファイルを復活させることはできません。