gitの使い方を毎度調べるのが面倒なのでまとめておく
2019.07.26
毎日 git を使っているなかで、「あれ?これどうやるんだっけ?」が多いので、自分用にまとめておこうと思う。
足りていない部分等は後日加筆修正する
ブランチを切りリモートに push するまで
-
ブランチの確認:
全ブランチを確認する:
git branch現在のブランチを確認する:
git branch --contains=HEAD -
ブランチを切る:
git checkout -b branch_name -
push する:
git push origin head -
ブランチを切り替える:
git checkout branch_name
コミットの取り消しを行う
- 直前のコミット実行取り消し:
git reset --soft head^ - 過去のコミット直後に戻す:
git reset --hard head^ - refs: http://www-creators.com/archives/1116
conflict を解消する
-
develop を最新にする:
git checkout developgit pull -
作業ブランチにマージする:
git checkout branch_namegit merge develop