14
17

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でpushするまでの流れ

Last updated at Posted at 2014-04-13

gitでpushするまでの流れは以下のとおり。

git add ファイル名

addした後、

  • git status
  • git diff --staged

で変更を確認すると良い。

git commit

  • (デフォルトだと)vimが立ち上がるので、vimでコミットメッセージを書く
  • メッセージはコミット内容を簡潔にわかりやすく書く

「index.htmlを更新しました」のように見てわかることを書いても意味ない。コミットの意図してることや、コードの変更だけではわからないようなことを補足的に記述しておくと良い。

git push origin master

  • originはリモートリポジトリのURLのエイリアス
  • masterのところはブランチ名を書く
  • master:masterは単にmasterと省略可能

まとめ

gitは、

  • 素のファイル

    ↓add

  • stage

    ↓commit

  • git local repository

    ↓push

  • git remote repository

の順に操作してpushする。

14
17
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
14
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?