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