It's about why I do not get the error "fatal: The current branch A has no upstream branch."
I deleted the REMOTE branch A with the command git push origin :A
.
Then I switched to LOCAL branch A with the command git checkout A
.
After adding, commiting and pushing, I don't get the error "fatal: The current branch A has no upstream branch."
Why does this error not appear even though the remote branch A does not exist because I deleted it before?
Because the error you expect to have is not related to the existence or not of the branch in the remote. It is related to the fact that your local branch has a "destination" defined ("upstream branch").
When you delete the remote branch, you don't unset the upstream branch from your local branch.
Your local branch can have a upstream branch defined that doesn't exist yet/anymore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With