Skip to content

Commit 7d76dc9

Browse files
committed
BUG: Migrate remote fetch configuration to main from master
For master to main migration.
1 parent 04f6239 commit 7d76dc9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Utilities/SetupForDevelopment.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ if git show-ref --verify --quiet refs/heads/master; then
143143
echo "Note: You may need to update the default branch on your remote repository."
144144
fi
145145

146+
# Update remote fetch configurations to use main instead of master
147+
for remote in $(git remote); do
148+
fetch_config=$(git config --get remote.$remote.fetch 2>/dev/null || true)
149+
if [[ "$fetch_config" == *"refs/heads/master:refs/remotes/$remote/master"* ]]; then
150+
echo "Updating $remote remote fetch configuration from master to main..."
151+
git config remote.$remote.fetch "+refs/heads/main:refs/remotes/$remote/main"
152+
fi
153+
done
154+
146155
# Switch back to the original branch if it wasn't master
147156
if test "$current_branch" != "master" && test "$current_branch" != ""; then
148157
echo "Switching back to '$current_branch' branch..."

0 commit comments

Comments
 (0)