0
1

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.

GitHub事始め

Last updated at Posted at 2017-09-11

GitHub始めました〜夏〜
ということで、自分のためにGitHubのコマンドのメモを残しておきます。

Gitにメールアドレスを登録する

$ git config --global user.name "Firstname Lastname"
$ git config --global user.email "your_email_address@gmail.com"

ここで設定した名前とアドレスはGitのログに残るので、公開してもいい感じのものにします。

CUIでGitHubにリポジトリを作成する

$ mkdir repos_name  #|ローカルにGit用のディレクトリを作成
$ cd repos_name     #|カレントディレクトリにして
$ git init .        #|ディレクトリにリポジトリを作成
$ hub create  #カレントディレクトリの名前でGitHubにリポジトリを作成
$ git remote -v  #設定したリモートサーバのURLを確認
  origin  git@github.com:username/repos_name.git (fetch)
  origin  git@github.com:username/repos_name.git (push)
$ hub browse  #リポジトリをブラウザで確認

ファイルをGitHubに上げる

$ vim readme.md  #GitHubに上げるファイルを作成
$ git add .  #ファイルをインデックスに登録
$ git commit -m "first commit"  #インデックスに追加されたファイルをコミットする
$ git push origin master  #GitHubにプッシュする

ファイルを削除する

$ git rm -r test.py  #ローカルのリポジトリからファイルを削除
$ git commit -m "Remove File"  #削除をコミットする
$ git push origin master  #削除をGitHubにプッシュする
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?