(二)Git-本地與遠程倉庫建立關聯


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指令見下


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM