LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   A git branch meant to be alternative fail to be swapped (https://www.linuxquestions.org/questions/linux-software-2/a-git-branch-meant-to-be-alternative-fail-to-be-swapped-4175685625/)

BudiKusasi 11-22-2020 03:20 AM

A git branch meant to be alternative fail to be swapped
 
I made a branch meant to be experimental and alternative to master so did

Code:

git branch M
after it's been worked, it turns out to be better, so did swap:
Code:

git branch  -m master old
git branch  -m M master

but when ready, did push, suddenly

fatal: The upstream branch of your current branch does not match
the name of your current branch. To push to the upstream branch
on the remote, use

git push origin HEAD:M
...

It didn't get synchronized into remote git.
How's the correct one, will anyone point out the important missing/subtle step ?

pan64 11-23-2020 12:52 AM

you forgot to tell us which command failed "did push ... fatal" is not enough.
From the other hand the usual way of working is to merge content and do not swap branch names. Especially altering master is not a good idea at all.


All times are GMT -5. The time now is 10:32 AM.