Humanity

Edit the world by your favorite way

2009-10-30から1日間の記事一覧

^q^o^p^

Cで二重typedefを避ける

C

今日id:mattnさんのブログで前見たハックを実際に使う場面があった。 apr.h typedef int uid_t; perl.h typedef long uid_t; もちろんこのヘッダを同時に読み込むとエラーになるんですが、こういう場合に私がよく使う手として #define uid_t _uid_t #include <apr.h></apr.h>…

「gitリポジトリからファイルを完全に消去する方法」をコマンドにしてみた

git

gitリポジトリに間違って追加してしまったファイル等を完全に消去する方法を紹介します。1 % git filter-branch -f --index-filter 'git update-index --remove "filename"' HEAD 2 % git push --forceディレクトリを削除したい場合は、ディレクトリの中身の…