infoMore than 5 years have passed since last update.
よく使う Git コマンドめも
Last updated at Posted at 2016-03-28
年がら年中やってる
作業したとき
- git add -p
- git commit -m "こめんと"
- git commit --amend
やっちまった
間違ってaddしちゃった
git reset HEAD ファイル名 #addの取り消し
CONFLICTした stash pop を無かったことにしたい
git checkout --ours .
git reset
git checkout .
別のブランチ持ってくるとき
- git fetch --prune
- git pull origin ブランチ名
- git branch hogehoge origin/hogehoge
ブランチ操作
- git branch -a #ブランチ一覧
- git branch -d ブランチ名 #ブランチ削除
- git checkout -b ブランチ名 #新しいブランチを作って、そっちにcheckout
リモートの確認
作業中に別の修正依頼がきちゃったよ
リベース
衝突を解決
git add 衝突したファイル
git rebase --continue
リベースをキャンセル
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
What you can do with signing up