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 3 years have passed since last update.

gitの簡易メモ

Last updated at Posted at 2020-06-04

用途

gitを利用するにあたって忘れたとき用の軽いメモ。

gitの導入

1.githubにリモートリポジトリを作成
2.ローカル環境にリポジトリを作成

$: git init

3.管理するフォルダをgithubのリモートリポジトリに登録

$: git remote add origin https://github.com/[ユーザー名]/[リポジトリ名].git

4.ファイルをインデックスに追加
addは指定したものをインデックスに追加するコマンド。
ここでは.で現在いるディレクトリを追加している。

$: git add .

5.addされたファイルをローカルリポジトリに登録

$: git commit

-m "コメント"でコメントをつけられる。

6.ローカルリポジトリをプッシュしてリモートリポジトリへ反映させる

$: git push -u origin master

gitの更新

1.変更をインデックスに追加
とりあえず管理するフォルダに移動し、.で全て指定していればよさそう。

$: git add .

2.ファイルをコミット

$: git commit -m "伝えたいこと"

3.リモートリポジトリにデータの送信

$: git push origin master

参考

これを書くにあたって以下の記事を参考にしました。

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?