LoginSignup
4
1

More than 5 years have passed since last update.

GitHubからリポジトリをcloneし、pushするまで

Posted at

GitHubからリポジトリをcloneし、pushするまで

新しい環境を作るたびに忘れるので、簡単なメモ

まずgitのユーザ名など登録を行う。
ここでのユーザ名はcmmmitログなどに表示される

git config --global user.name "ユーザ名"
git config --global user.email "メールアドレス"

次にsshキーの作成と確認を行う

ssh-keygen -t rsa -b 4096 -C "メールアドレス"

キーが作成できたら、publicの方をコピーしてgithubのSSHキーに追加する
以下コマンドで確認できる

cat ~/.ssh/id_rsa.pub

pushできるようにリモートブランチを追加しておく


git remote add origin リモートリポリトリのURL

次にリモートからリポジトリをCloneしてくる

git clone リモートリポリトリのURL

必要な内容変更を行ったら、以下のコマンドでpushできる

gid add .
git commit -m "メッセージ"
git push origin master
4
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
4
1