githubにリポジトリを作成、ローカルリポジトリからPUSHまで

既にgithubの使い方は説明しているがSSHを使用しない方法を記載

PC上にはgit for windowsがインストール済であることを前提とする

github上でリポジトリを作成

PC上にローカルリポジトリのフォルダ「myrepo」を作成

カレントを「myrepo」に移動しローカルリポジトリを初期化

C:\projects\test\git>mkdir myrepo
C:\projects\test\git>cd myrepo
C:\projects\test\git\myrepo>git init
Initialized empty Git repository in C:/projects/test/git/myrepo/.git/
C:\projects\test\git\myrepo>

ファイルを作成して「add」、「commit」

C:\projects\test\git\myrepo>echo hello > readme.txt
C:\projects\test\git\myrepo>git add .
C:\projects\test\git\myrepo>git commit -m "comment"

github上からリポジトリのURLをコピー

リモートリポジトリを設定し、push
※githubのアカウントを聞かれたらメールアドレスとパスワードを入力

C:\projects\test\git\myrepo>git remote add origin https://github.com/省略/myrep.git
C:\projects\test\git\myrepo>git push origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 216 bytes | 216.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/省略/myrep.git
 * [new branch]      master -> master

C:\projects\test\git\myrepo>