廣州哪里有學做網(wǎng)站的瀏覽器網(wǎng)站大全
目錄
1 確認自己電腦上已經(jīng)安裝好Git
2 添加GitHub賬號
2.1 Setting -> 搜索GitHub-> ‘+’ -> Log In with Token
2.2 點擊Generate 去GitHub生成Token
2.3 勾選SSH后其他不變直接生成token
2.4 然后復制token添加登錄賬號即可
3 點擊導航欄中VCS -> Create Git Repository 創(chuàng)建本地Git倉庫
4 導航中的VCS會變?yōu)镚it,上傳項目到GitHub倉庫
4.1 確認信息
4.2 上傳成功
4.3 查看GitHub倉庫,上傳成功
5 解決SSH問題錯誤
5.1 錯誤
5.2 原因: GitHub未識別到SSH Key
5.3 解決方案: 在GitHub網(wǎng)站中添加SSH Key 即可
5.3.1?檢查是否已有SSH密鑰
5.3.2?如果沒有SSH密鑰,生成一個新的
5.3.3?添加SSH密鑰到ssh-agent
5.3.4?將SSH公鑰添加到GitHub
5.3.5?測試連接
1 確認自己電腦上已經(jīng)安裝好Git
打開IDEA -> Setting -> 搜索Git -> Test
2 添加GitHub賬號
2.1 Setting -> 搜索GitHub-> ‘+’ -> Log In with Token
2.2 點擊Generate 去GitHub生成Token
2.3 勾選SSH后其他不變直接生成token
2.4 然后復制token添加登錄賬號即可
3 點擊導航欄中VCS -> Create Git Repository 創(chuàng)建本地Git倉庫
4 導航中的VCS會變?yōu)镚it,上傳項目到GitHub倉庫
點擊Git -> GitHub?-> Share Project on GitHub
4.1 確認信息
4.2 上傳成功
若失敗看最后的錯誤?5 解決SSH問題錯誤
4.3 查看GitHub倉庫,上傳成功
5 解決SSH問題錯誤
5.1 錯誤
Successfully created project 'AlgorithmTraining' on GitHub, but initial push failed: Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. git@github.com: Permission denied (publickey). Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
5.2 原因: GitHub未識別到SSH Key
5.3 解決方案: 在GitHub網(wǎng)站中添加SSH Key 即可
5.3.1?檢查是否已有SSH密鑰
首先,檢查你是否已經(jīng)有一個SSH密鑰:
ls -al ~/.ssh
5.3.2?如果沒有SSH密鑰,生成一個新的
如果你沒有看到任何密鑰文件,你需要生成一個新的SSH密鑰:
ssh-keygen -t ed25519 -C "你的郵件地址"
如果你使用的是較老的系統(tǒng),不支持ed25519,你可以使用rsa:
ssh-keygen -t rsa -b 4096 -C "你的郵件地址"
然后一直按Enter,使用默認設置。
5.3.3?添加SSH密鑰到ssh-agent
確保ssh-agent正在運行,然后將你的SSH密鑰添加到ssh-agent:
5.3.4?將SSH公鑰添加到GitHub
復制你的公鑰到剪貼板:
cat ~/.ssh/id_ed25519.pub # 如果你使用的是rsa密鑰,請將id_ed25519.pub改為id_rsa.pub
然后登錄GitHub,進入 SSH和GPG密鑰設置頁面https://github.com/settings/keys點擊 “New SSH key”,粘貼你的公鑰,并保存。
5.3.5?測試連接
測試是否能夠成功連接到GitHub:
ssh -T git@github.com
這表示你已經(jīng)成功連接到GitHub。
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
之后重來之前的4 導航中的VCS會變?yōu)镚it,上傳項目到GitHub倉庫步驟即可。