devlog

http://twitter.com/yusukei

git覚書

新たにリモートブランチへpushする

# git push origin test

pushした際には.git/configに

[branch "local_branch_name"]
remotes = origin
merge = refs/heads/test

を書かないとブランチ名が必要になる。

リモートのブランチからブランチする

# git branch -a
  remotes/origin/test

となっている場合、そのまま

# git checkout remotes/origin/test

とはできない。 一度、ローカルにブランチを切る必要がある。

# git checkout test remotes/origin/test
# git checkout test
# git pull
# git push

リモートのブランチ名とローカルのブランチ名が一致しない場合は

# git push origin test
# git pull origin test

とすること

upstream mode

git config --global push.default upstream