LoginSignup
0

More than 3 years have passed since last update.

2年ぶりにGitを使ったのでコマンドを書いておく

Last updated at Posted at 2018-10-18

コマンド一覧

  • cloneする

$ git clone "URL"

  • リモートブランチを確認

$ git branch -r

  • リモートから最新情報を持ってくる

$ git fetch

  • リモートにあるブランチを持ってくる

$ git checkout -b "ローカルブランチ名" origin/"リモートブランチ名"

  • (例)リモートにあるブランチを持ってくる

$ git checkout -b test origin/test

  • 作業ブランチを切る

$ git checkout -b "開発用のブランチ名"

  • リモートブランチでローカルブランチを最新化

$ git pull --rebase origin "ブランチ名"

  • ステータス確認

$ git status

  • Gitの管理対象に入れる

$ git add "ファイル名"

  • コミット

$ git commit

  • リモートにPush

$ git push origin "開発用のブランチ名"

  • ブランチ切り替え

$ git checkout "ブランチ名"

  • マージ(プルリクがコンフリクトした時にローカルで修正する)

$ git merge --no-ff "マージする側"

  • マージ済みローカルブランチ削除

$ git branch -d "ブランチ名"

  • ローカルブランチ削除

$ git branch -D "ブランチ名"

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