LoginSignup
9
8

More than 5 years have passed since last update.

よく使う Git コマンドめも

Last updated at Posted at 2016-03-28

年がら年中やってる

  • git status

作業したとき

  • 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 remote -v

作業中に別の修正依頼がきちゃったよ

  • git stash
  • git stash pop

リベース

衝突を解決

git add 衝突したファイル
git rebase --continue

リベースをキャンセル

git rebase --abort
9
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
8