$ git checkout upstream $ rm -rf * $ tar xf ~/tokyocabinet-1.1.15.tar.gz --strip 1 $ git add . $ git commit -as $ mv ~/tokyocabinet-1.1.15.tar.gz ../tokyocabinet_1.1.15.orig.tar.gz $ pristine-tar commit ../tokyocabinet_1.1.15.orig.tar.gz `git rev-parse HEAD` That's it