0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Git でよく使うコマンドまとめ

Posted at

リモートリポジトリとのやりとり

リモートリポジトリを新規ディレクトリにコピー

git clone <リポジトリのURL>

上流ブランチ(デフォルトで origin レポジトリ)を現在のブランチにマージ

git pull

上流ブランチを指定して現在のブランチを反映

git push -u origin <ブランチ名>

現在のブランチを上流ブランチに反映

git push

ブランチの操作

ブランチのリストを表示

git branch

ブランチを作成して切り替え

git checkout -b <ブランチ名>

ブランチを切り替え

git checkout <ブランチ名>

指定したブランチを現在のブランチにマージ

git merge <ブランチ名>

ブランチを削除

git branch -d <ブランチ名>

ローカルリポジトリでの操作

変更されたファイルを確認

git status

変更箇所を確認

git diff

ファイルの追加・更新をインデックスに追加してコミット

git add <ファイル/ディレクトリのパス>
git commit -m "<コメント>"

すべてのファイルの更新をインデックスに追加してコミット

git commit -am "<コメント>"
0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?