File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff 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..."
You can’t perform that action at this time.
0 commit comments