I am getting zsh: number expected
whenever I`m running the following command:-
Command - git push --set-upstream origin branch_name
I`m using Oh My Zsh as my terminal in MacBook Pro with M1 chip.
I even tried another command like git push -u origin my_branch
, but this also not working giving out the same error message zsh: number expected
More on use of --set-upstream here & why do we need to do it all the time is here.
I got the solution for this issue:
Earlier I was running git push --set-upstream origin branch_name
, with some library name in the branch name within the brackets.
For instance:
git push --set-upstream origin resampling(asyncio)
What I found out is, ()
usually treats the content somehow differently.
And I was having zsh: number expected error as it was expecting a version number for the mentioned library.
To resolve this, I made a new branch and removed ()
from the branch name & the same command git push --set-upstream origin branch_name
worked fine.
Hope this answer would be helpful for the community.