The quickest and easiest way to find such information ia via
git itself. Using
git branch --help should output numerous lines of the manual pages which explain all the possible options and flags available for
git branch. There are lots of options for viewing manuals
man git-branch such as paging tools, passing output to text searches like grep
git-branch --help | grep -e "-M" or opening them in your browser. Have a look into what suits you as you’ll use manuals frequently if you make use of the command line.
To save you the trouble this time around using
-M should rename your current branch to the given target name (even if a branch with that name exists). From the manuals-
With a -m or -M option, <oldbranch> will be renamed to <newbranch>. If <oldbranch> had a corresponding reflog, it is renamed to match <newbranch>, and a reflog entry is created to remember the branch renaming. If <newbranch> exists, -M must be used to force the rename to happen.
You can view the name of the current branch with
git branch on its own (your current branch would have an asterisk next to its name).
I’m not 100% sure why the process hangs on the next step though. I’d have thought it should be prompting you for your git login details at that point to authorise your
https push. Something seems to be wrong in this instance. I have seen several similar queries in the last few weeks that all seem to be: windows, git bash, git push issues.
This could be an issue with
git, with some form of windows authentication tool or a very small chance (I doubt this one) the bug is with gitbash. I’d highly suggest a web search for those terms or very similar- “windows gitbash push hangs” (limited to last month or two) to see if you can find a known issue. If you find a solution then please share it as I think others have been caught out by this recently.
If you cannot find a solution I think you could look into using
ssh authentication instead of
https or you could try using a different CLI such as powershell or cmd to see if that is successful instead.