# Renames local branch master to main
git branch -m master main
git fetch origin
# Set up main to track upstream branch main
git branch -u origin/main main
# Changes default branch be set to main for remote origin
git remote set-head origin --auto
Proposed parameters
Parameter
Mandatory
Data type
Description
Default value
Allowed values
Name
Yes
String
Specifies the current branch name
None
-
NewName
Yes
String
Specifies the branch name to rename to
None
-
RemoteName
No
String
Specifies the remote that has the upstream branch. This is required if any of the two switch parameters are used
'origin'
-
SetDefault
No
Switch
Indicates that the new branch name should be set to the default for the remote
None
-
TrackUpstream
No
Switch
Indicates that the new branch name should be set to the track the branch in he remote
Command proposal
Command to run:
Proposed parameters
Special considerations or limitations
None.