0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

github.com の default branch が main になっていたので敢えて master に戻した話

Last updated at Posted at 2020-10-28

github.com で新規に repository を作成すると default branch が main になっていた。

※現在は github の repository 作成直後に rename が最速

repository
 settings
  branches
   edit - rename

main is now named master
If you have a local clone, you can update it by running:

git branch -m main master
git fetch origin
git branch -u origin/master master
git remote set-head origin -a

(以下、過去の内容)
やったことのメモ(最短じゃないので適当)

git branch master
git checkout master
touch README.md
git add ./README.md
git commit -m 'first commit'
git merge main
git gc
git push origin main
git branch -D main
(create branch master as empty on the web github.com)
(change default to branch master on the web github.com)
git push -f origin master
git push --delete origin main
git branch -r
git rebase -i HEAD~~
(fixup)
git log
git commit --amend
git log
git push -f origin master
touch README.md
git add ./README.md
git commit -m 'first commit'
git push origin master
git remote set-head origin --auto
git branch -r
git gc

0
0
2

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?