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

0
Last updated at Posted at 2021-04-09

はじめに

学習をしている中でgit をよく使用するのですが、少しごちゃごちゃして整理したいと考えていました。
そこで備忘録としてファイルを変更した時は必ず更新するための手順を振り返ります。

初学者のため、不足している箇所等ありましたらご指摘いただけると幸いです。

1 現在のディレクトリにリポジトリを作成する。

$ git init 

init の後にディレクトリ名を加えれば、指定したディレクトリに対するリポジトリを作成する。

2 コミットの対象となるコンテンツをステージングする

$ git add オプション

ステージングとはGitリポジトリにコミットするファイルを置いておくための作業。
Git管理の対象に入れるかでオプションが変化する。

3 コミットする

$ git commit -m “日付など”

“”の中は任意だがコミットした内容がわかるような名前や日付等をつけると良い。

4 ローカルリポジトリの内容をリモートリポジトリに反映する

$ git push origin main 

リモートリポジトリ Origin の main ブランチにコミットの内容を反映する。
これでリモートリポジトリにローカルでのファイル変更を反映できる。

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?