![](/img/trans.png)
[英]How do I use Bash on Ubuntu on Windows (WSL) for my VS Code terminal?
[英]Using git through wsl (ubuntu) & windows terminal, how do you change the default branch name to main?
通過wsl (ubuntu) & windows終端使用git,如何將默認分支名稱改為main?
我已經嘗試過:
git config --global init.defaultBranch main
當我查看時,設置“init.defaultbranch = main”就在那里:
git config --global --list
但是當我嘗試在一個全新的文件夾中創建一個新的 git init 時,它仍然使用 master ......有什么想法嗎?
所以事實證明你需要 git 版本 2.28 或更高版本。 即使幾個月前我剛剛安裝了 git,我也有 git 版本 2.25.1。 對於 Ubuntu 來說,您似乎必須跳過幾圈才能獲得最新版本。
這是我嘗試過的
sudo apt-add-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
之后,您可以使用以下命令檢查您的版本:
git --version
如果您在我的問題的代碼中添加了全局設置,那么您應該對 go 很好。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.