LoginSignup
0
0

More than 3 years have passed since last update.

Gitコマンド

Posted at

リポジトリを作成

作成後に表示されるURLをメモしておく

  • 作業フォルダを作成し、移動する

(後のローカルリポジトリなので、1で作成したリポジトリ名に合わせると良い)

$ mkdir work

$ cd work
  • ローカルリポジトリとして初期化する
$ git init
  • ファイルをインデックスと呼ばれる領域に登録する(ステージングという)
$ git add ファイル名
  • ステージングしたファイルをコミットする

mオプションでコミットにメッセージを付与

$ git commit -m "first commit"
  • リモートリポジトリに登録
$ git remote add origin メモしたURL

$ git push origin master

リモートブランチを取り込む

  • リモートブランチの変更を取り込む
$ git pull origin ブランチ名
  • ローカルリポジトリにローカルブランチを作成
$ git checkout -b ブランチ名 origin/ブランチ名
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