0
0

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基本操作

Last updated at Posted at 2020-02-01

ファイル編集→Git管理の基本的な流れ

※commitはアプリが正しく動いてる段階でこまめに行いましょう。

①最新のリモートのブランチ一覧をローカルに持ってくる。

$ git fetch  

### ②現在存在するリモートブランチ一覧を確認する。
$ git branch -r 

### ③利用したいリモートのブランチのローカルブランチを作成し、同時に作成したブランチへ移動する。
$ git checkout -b ローカルに作るブランチ名 origin/リモートから持ってきたいブランチ名 

### ④(ファイルを編集した後)編集したファイルの前回のcommitからの変更内容(差分)を確認する。
$ git diff ファイルパス/ファイル名 

⑤編集したファイルをステージングする。

ステージングしたいファイル全てを選択する。

$ git add ファイルパス/ファイル名 

⑥ローカルリポジトリの変更内容をコミットする。

$ git commit -m "コミットメッセージ" 

⑦ローカルブランチの変更内容をリモートブランチにプッシュする。

$ git push origin 内容を反映したいリモートブランチ名 

⑧ローカルブランチの内容を最新化する。

$ git pull 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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?