git

gitで複数のauthor, committerの使い分け

git

環境変数で設定すっと上書きしてくれる % git config --help user.email Your email address to be recorded in any newly created commits. Can be overridden by the GIT_AUTHOR_EMAIL, GIT_COMMITTER_EMAIL, and EMAIL environment variables. See git-co…

gitのリポジトリをsubversion用に変換

とりあえず、gitレポジトリは、git-flowで運用前提 git-svnで、svnリポジトリを取得 % git svn clone svn://path/to/repo -T trunk -t tags -b branches --prefix=svn/ gitのリポジトリをgit-svn のリモートとして登録 % cd repo % git remote add org git@g…

gitのtag

git

// タグ付け % git tag -a TAG_NAME % git tag -a TAG_NAME -m 'message' // タグ一覧 % git tag -l // タグをリモートにpush % git push origin TAG_NAME // ローカルのタグをすべてサーバにpushする % git push --tags % git push origin --tags // 削除 %…

merge, rebase をもとに戻す

git

% git reset --hard ORIG_HEADgit/git rebaseを元に戻す方法 - TOBY SOFT wiki

tigのインストール

libiconv, ncurses はインストール済み % port installed The following ports are currently installed: libiconv @1.14_0+cp932fix+enable_cp932fix (active) ncurses @5.9_1 (active) とりあえず、依存関係確認 % port deps tig Full Name: tig @0.17_0 L…

空のディレクトリに.emptyを追加する

git

% find . -type d -empty -not -path './.git*' -exec touch {}\/.empty \;.gitignore % find . -type d -empty -not -path './.git*' -exec touch {}\/.gitignore \;

全てのsubmoduleを一括更新

git

% git submodule foreach 'git checkout master; git pull origin master'

summary

git

% git diff commit..HEAD --stat --summary

submoduleの削除

git

.gitmodulesファイルから該当する行を削除 [submodule "path/to/hoge"] path = path/to/hoge url = git://github.com/hoge/hoge.git .git/configファイルから該当する行を削除 [submodule "path/to/hoge"] url = git://github.com/hoge/hoge.git で % git rm…

pathogen.vim & github

vim-scripts · GitHub http://www.allenwei.cn/tips-using-git-submodule-keep-your-plugin-up-to-date/

git pullの差分

git

% git log HEAD@{1}..HEAD -p --reversehttp://d.hatena.ne.jp/thinca/20100713/1278952492

リモートのブランチを元にローカルのブランチを作成

git

% git fetch リモートリポジトリ ブランチ % git checkout -b ブランチ FETCH_HEAD

initial commit

git

% git init % git commit --allow-empty -m 'initial commit' remote一覧 % git remote -v show

svn:externalにgitのリポジトリ

externalじゃないけど http://6brand.com/git-svn-externals-rails-plugins.html % git cloneしてから % svn addでオケあらかじめ、~/.subversion/config に .gitを、 ~/.gitignoreに.svnを追加しておく