使用までの環境設定
Gitのインストール
- git for Windowsのサイトからダウンロード
- 既定値でインストール。
Gitの初期設定
- Git Bash を起動。以下、コマンドで設定。
- Gitのユーザ名を登録。
git config –global user.name gxxxh - e-mailを登録。
git config –global user.email gxxxh@gmail.com - 登録されたか確認。
git config –list
GitHub アカウントを作成する
- GitHub Japan のサイトから「GitHubに登録する」をクリックして登録。
- すでに登録済の場合は、サインインする。
リモートリポジトリを作成する
- 「create repository」をクリック
- 必要項目に入力
Repository name: Sample1
Public / Private: Private
Initialize this repository with:他のユーザのために READ_MEファイルを設置する場合はチェック。
他の項目は既定値のままでOK. - 「Create repository」ボタンをクリック。
ローカルリポジトリを作成する
- Git Bashで、以下のコマンドを順番に実行。リポジトリ名は任意の名前。
mkdir github
cd github
mkdir sample1
cd sample1 - 作成したリポジトリをローカルリポジトリにします。
git init - ローカルリポジトリの作成が完了すると、以下のように表示される。
Initialized empty Git repository in C:/Users/gxxx/github/sample1/.git/
コメント