1、本地創建文件夾 文件夾目錄下運行git bash(右鍵點擊git bash here),git init命令初始化本地項目(生成.git文件夾)
$ git init
2、github上創建項目,獲取其路徑
創建
獲取
3、建立關聯
86186@LAPTOP-FQC5NMUF MINGW64 ~/WeChatProjects/hello (master) $ git remote add origin https://github.com/xx
看連接是否成功
86186@LAPTOP-FQC5NMUF MINGW64 ~/WeChatProjects/hello (master) $ ssh -T git@github.com
注:第一次push等操作時會出現警告
The authenticity of host 'xx' can't be established.
RSA key fingerprint is xx.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
輸入yes回車即可,此時會輸出一個警告,告訴你已將key添加到本機的信任列表,僅第一次會出現
Warning: Permanently added 'xx' (RSA) to the list of known hosts.
...接着如何使用一些相關的git指令見下