1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WSLのgitはいまだにデフォルトのブランチ名にmasterを使っている気がする →衝撃の結果

Last updated at Posted at 2025-06-11

タイトル通り。vscodeでpushしたときにびびり散らかしました。

そもそも

image-1.png

なんでだ

WSLでgitの設定をする

設定していないからですね。
こちらの記事が参考になります。

Git ことはじめ (for Ubuntu)

以下は重要です。デフォルトがmasterっぽいので。

git config --global init.defaultbranch 'main'

結果

やったね

image.png

と思ったら

もしかしてwindowsの設定に引っ張られてるっぽい?
そういえばwindowsのgitのほうが昔から使ってる。

image.png

masterだー!!!

git config --global init.defaultbranch 'main'

直らない。

再設定にはまず取り消してからの模様。
設定の取り消しには --unset を使う.

git config --global --unset init.defaultbranch

そして改めて

git config --global init.defaultbranch 'main'

やっぱ直んねえ。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?