![vscode如何配置git](https://img.php.cn/upload/article/000/000/020/5dc8c0424cba8170.jpg)
vscode如何設定git?
vscode中對git進行了集成,很多操作只需點擊就能操作,無需寫一些git指令。
不過這就需要你對vscode進行設定。下面我會講到git的設定與免密碼上傳github
推薦教學:vscode教學
1.vscode中git的設定
##首先需要你的電腦上已經安裝了git,並且window電腦裡git加入到環境變數中去了。
![1573437291806282.png vscode如何配置git](https://img.php.cn/upload/image/121/539/103/1573437291806282.png)
這樣你的電腦就可以使用git了,但想要在vccode中使用git還要設定git.path。
git.path是git中的exe檔路徑,找到你的電腦git的安裝目錄,找到裡面的cmd資料夾。裡面的git.exe檔把該檔案的完整路徑複製下來。
![1573437296477487.png vscode如何配置git](https://img.php.cn/upload/image/648/375/831/1573437296477487.png)
點選設定在設定裡找到git設定裡面的git.path選項。將設定複製到右邊的使用者預設設定
![1573437303233138.png vscode如何配置git](https://img.php.cn/upload/image/588/204/989/1573437303233138.png)
把git.exe檔的路徑複製到這裡就可以了。
2.vacode中git的使用,與github的免密碼上傳
先中指令git init在資料夾建立git相關設定文件,然後用執行以下幾句
![1573437313117917.png vscode如何配置git](https://img.php.cn/upload/image/357/134/576/1573437313117917.png)
目前分支就是主分支,上傳到github上了
![1573437318765256.png vscode如何配置git](https://img.php.cn/upload/image/533/568/821/1573437318765256.png)
#這樣每次上傳是都需要輸入git倉庫的使用者名稱和密碼(這裡也就是github的用戶名和密碼)
git的免密碼上傳的設定為,找到資料夾的.git資料夾
![1573437334965318.png vscode如何配置git](https://img.php.cn/upload/image/743/282/271/1573437334965318.png)
裡面設定檔config
![1573437340920201.png vscode如何配置git](https://img.php.cn/upload/image/920/508/156/1573437340920201.png)
![1573437344677793.png vscode如何配置git](https://img.php.cn/upload/image/228/404/791/1573437344677793.png)
裡面的url本來就是是https://github.com/**&/ &&&&.git
替換為https://github使用者名稱:github密碼@github.com/&&&&/ &&.git這樣每次推送到github倉庫就不需要輸入帳戶和密碼了
以上是vscode如何配置git的詳細內容。更多資訊請關注PHP中文網其他相關文章!