The Pragmatic Ball boy

iOSを中心にやってる万年球拾いの老害エンジニアメモ

gitによる開発フロー

・設定

エディタをviからemacsに変更
git config --global core.editor 'emacs'

・開発フロー
A successful git branching model をベースに開発を行う場合の手順。
http://keijinsonyaban.blogspot.jp/2010/10/successful-git-branching-model.html

・管理者
gitリポジトリをまずつくる
git init

touch README

git add README

git commit -m "initial commit"

git remote add origin http://xxxxxx/xxx.git

git push origin master

developブランチをつくる
git checkout -b develop

developブランチをremoteリポジトリにpush
git push origin develop

・開発者
develop ブランチをブランチしてfeature1を開発する場合

remoteのdevelopブランチをチェックアウト
git checkout origin/develop -b feature1

commitする
git commit -m ""

commitをまとめる
git rebase -i HEAD~5

developの変更を取り込む
git pull --rebase origin develop

競合の解決をする

競合を解決したファイルをadd
git add

rebaseを完了させる
git rebase --continue

pushする
git push origin feature1