Actions

Difference between revisions of "開発者エリア/Gitデフォルトブランチを「master」から「main」に切り替える"

From Mahara Wiki

Line 3: Line 3:
 
2021年10月14日、私たちはメインのGitブランチを「master」から「main」に切り替えました。すでに開発目的でローカルのMaharaインスタンスを動作させている場合、Gerritにコードを正しくプッシュするため、いくつか変更する必要があります。
 
2021年10月14日、私たちはメインのGitブランチを「master」から「main」に切り替えました。すでに開発目的でローカルのMaharaインスタンスを動作させている場合、Gerritにコードを正しくプッシュするため、いくつか変更する必要があります。
  
== あなたのローカルセットアップを新しいブランチを指すために変更する Change your local setup to point to the new branch==
+
== あなたのローカルセットアップを新しいブランチを指すために変更する ==
  
The following instructions are taken from '[https://www.git-tower.com/learn/git/faq/git-rename-master-to-main/ How to change your master branch to main in Git]
 
 
以下のインストラクションは「[https://www.git-tower.com/learn/git/faq/git-rename-master-to-main/ How to change your master branch to main in Git] 」(英語) から取得したものです。
 
以下のインストラクションは「[https://www.git-tower.com/learn/git/faq/git-rename-master-to-main/ How to change your master branch to main in Git] 」(英語) から取得したものです。
  

Revision as of 10:18, 29 May 2022

作成中です - mits (talk)

2021年10月14日、私たちはメインのGitブランチを「master」から「main」に切り替えました。すでに開発目的でローカルのMaharaインスタンスを動作させている場合、Gerritにコードを正しくプッシュするため、いくつか変更する必要があります。

あなたのローカルセットアップを新しいブランチを指すために変更する

以下のインストラクションは「How to change your master branch to main in Git 」(英語) から取得したものです。

# Switch to the "master" branch:
$ git checkout master

# Rename it to "main":
$ git branch -m master main

# Get the latest commits (and branches!) from the remote:
$ git fetch

# Remove the existing tracking connection with "origin/master":
$ git branch --unset-upstream

# Create a new tracking connection with the new "origin/main" branch:
$ git branch -u origin/main

For good measure, run

 git pull

once done just to get the latest code.

Update the Gerrit hook

  1. Open the file 'post-checkout' in '.git/hooks'.
  2. Find 'master' and change it to 'main'.
  3. Save the file.