1
4

More than 3 years have passed since last update.

[git] gitコマンド一覧

Last updated at Posted at 2020-08-26

add前の変更を削除

git restore <file名>

add前の変更内容確認(特定のファイル)

git diff -- <file名>

addの取り消し(特定のファイル)

git rm --cached -r <file名>

add後に変更内容確認(特定のファイル)

git diff --cached <file名>

add[全てのファイル]

git add .

add[特定のファイル]

git add [ファイル名]

ブランチの確認

git branch

ブランチの切替

git checkout ブランチ名

ブランチ作成

git checkout -b 作成するブランチ名

現在のブランチから作成される

ブランチ削除 [マージ済みのみ]

git branch -d [ブランチ名]

ブランチ削除 [マージ前も可]

git branch -D [ブランチ名]

コミット[コメント付き]

git commit -m 'コメント'

直前のコミット取り消し

git revert HEAD

リモートへプッシュ

git push origin リモートブランチ名

リモートから変更内容を取り込む

git pull origin ローカルブランチ名

随時更新していきます。

1
4
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
1
4