0
0

Gitコマンド一覧

Posted at

ユーザーネーム・ユーザーメール 設定

git config --global user.name "Test"
git config --global user.email "test@gmail.com"

ユーザーネーム・ユーザーメール 確認
git config --global user.name
git config --global user.email

リポジトリを新規に作成
git init

現在のディレクトリとサブディレクトリ内の新規ファイルと変更をステージング
git add .

リポジトリの現在の状態を表示
git status

変更をコメント付きでコミットする
git commit -m "test"

GitHubとGitを関連付ける
git remote add origin <GitHubリポジトリのURL>

変更をGitHubリポジトリにプッシュ
git push -u origin master

コミット履歴を表示
git log

リモートリポジトリからクローンする
git clone <GitHubリポジトリのURL>

ブランチ一覧表示
git branch

ブランチ作成
git branch <新しいブランチ名>

ブランチ削除
git branch -d <削除するブランチ名>

ブランチ切り替え
git checkout <ブランチ名>

ブランチAをブランチBにマージ(git checkout B でブランチBに切り替えておく)
git merge <ブランチA>

リモートリポジトリから変更をフェッチしてマージ
git pull
0
0
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
0