Skip to content

Commit d0b8f9f

Browse files
committed
BUG: Ensure branch.main.merge is set to refs/heads/main
For primary branch master to main transition.
1 parent 7d76dc9 commit d0b8f9f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Utilities/SetupForDevelopment.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,23 @@ if git show-ref --verify --quiet refs/heads/master; then
134134
# Update the upstream tracking if it exists
135135
if git config --get branch.master.remote > /dev/null 2>&1; then
136136
remote_name=$(git config --get branch.master.remote)
137+
merge_ref=$(git config --get branch.master.merge 2>/dev/null || true)
138+
139+
# Set up the main branch configuration
137140
git config branch.main.remote "$remote_name"
138141
git config branch.main.merge refs/heads/main
142+
143+
# Clean up old master branch configuration
139144
git config --unset branch.master.remote 2>/dev/null || true
140145
git config --unset branch.master.merge 2>/dev/null || true
141146

142147
echo "Updated upstream tracking to $remote_name/main"
143148
echo "Note: You may need to update the default branch on your remote repository."
144149
fi
145150

151+
# Ensure main branch merge configuration is set to main
152+
git config branch.main.merge refs/heads/main 2>/dev/null || true
153+
146154
# Update remote fetch configurations to use main instead of master
147155
for remote in $(git remote); do
148156
fetch_config=$(git config --get remote.$remote.fetch 2>/dev/null || true)

0 commit comments

Comments
 (0)