githubにリポジトリを作成してpushしたときのメモ

投稿者: | 2017-09-16

参考:GitとGithubの使い方~超初級編~ – nigoblog
http://nigohiroki.hatenablog.com/entry/2012/09/12/000003
githubについては、すでに登録済みだったので、リポジトリを作成する。
githubの右上のプラスボタンを押して、New Repositoryページに飛ぶ
https://github.com/new
Repository name:tutorial
Description (optional):チュートリアルテスト
以下困る
Initialize this repository with a README
This will let you immediately clone the repository to your computer. Skip this step if you’re importing an existing repository.
READMEにこのリポジトリを初期化します
これは、すぐにお使いのコンピュータにリポジトリをクローンできるようになる。既存のリポジトリをインポートしている場合は、このステップをスキップします。
とりあえず、チェックせずに作成してみる。
ページできた。
https://github.com/xxxxx/tutorial
Quick setup — if you’ve done this kind of thing before
Set up in Desktop or
HTTPS
SSH
We recommend every repository include a README, LICENSE, and .gitignore.
…or create a new repository on the command line
echo “# tutorial” >> README.md
git init
git add README.md
git commit -m “first commit”
git remote add origin https://github.com/xxxxx/tutorial.git
git push -u origin master
…or push an existing repository from the command line
git remote add origin https://github.com/xxxxx/tutorial.git
git push -u origin master
…or import code from another repository
You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
とりあえず、
2つ目の
…or push an existing repository from the command line
git remote add origin https://github.com/xxxxx/tutorial.git
git push -u origin master
を試してみる。
yukias-MBA:tutorial yukias$ git remote add origin https://github.com/xxxxx/tutorial.git
yukias-MBA:tutorial yukias$ git push -u origin master
Username for ‘https://github.com’: xxxxx
Password for ‘https://xxxxx@github.com’:
Counting objects: 3, done.
Writing objects: 100% (3/3), 247 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/xxxxx/tutorial.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
githubのIDとパスワードを聞かれたので入力。
成功したっぽい。