gitリモートウェアハウスへの最初の接続
1658 ワード
gitリモートウェアハウスへの最初の接続
1.初回git commit
グローバルuser nameとemailが設定されていません
//
git config --global user.name "mr"
git config --global user.email "mr"
2.リモートgithub倉庫への接続
プッシュ時に問題が発生
//
git config --global --unset user.name
git config --global --unset user.email
// github email
git config --global user.name "NJUPT-ZhangAn"
git config --global user.email "[email protected]"
rsa-public keyの追加
:
ssh-keygen -t rsa -C " "
//
Generating public/private rsa key pair.
Enter file in which to save the key (/home/an/.ssh/id_rsa): id_rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
SHA256:+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The key's randomart image is:
公開鍵のインポート
id_rsa.pubのコンテンツをgithubにコピーする:https://github.com/settings/keysに表示されます.cat id_rsa.pub//
テスト:
ssh :
ssh-agent -s
:( , home )
ssh-add ~/.ssh/id_rsa
このステップを先にテストすることができます. :
ssh -T [email protected]
:
Hi NJUPT-ZhangAn! You've successfully authenticated, but GitHub does not provide shell access.
PUSH:
git push -u origin master
//
git config --global user.name "mr"
git config --global user.email "mr"
プッシュ時に問題が発生
//
git config --global --unset user.name
git config --global --unset user.email
// github email
git config --global user.name "NJUPT-ZhangAn"
git config --global user.email "[email protected]"
rsa-public keyの追加
:
ssh-keygen -t rsa -C " "
//
Generating public/private rsa key pair.
Enter file in which to save the key (/home/an/.ssh/id_rsa): id_rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
SHA256:+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
The key's randomart image is:
公開鍵のインポート
id_rsa.pubのコンテンツをgithubにコピーする:https://github.com/settings/keysに表示されます.
cat id_rsa.pub//
テスト:
ssh :
ssh-agent -s
:( , home )
ssh-add ~/.ssh/id_rsa
このステップを先にテストすることができます.
:
ssh -T [email protected]
:
Hi NJUPT-ZhangAn! You've successfully authenticated, but GitHub does not provide shell access.
PUSH:
git push -u origin master