I have created a remote repo using my GitHub account at https://github.com/darKoram/sphero_tracker.git. So far it just contains some wiki pages, but I\'m ready to upload my
In my case I am also getting the same error.
fatal: remote part of refspec is not a valid name in https://github.com/username/repo.git
Firstly I thought it is due to changing the username( as I recently change my username on github) but that's not a problem.
When I tried git fetch and then git pull but getting the same error.
At Last this is just solved by
git push origin master
No Idea but this worked.
I had a similar problem today. FWIW, this fixed it:
git fetch
followed by git pull origin mybranch
(response: "Already up-to-date")
then git push origin mybranch
.
I suspect maybe something related to the upstream parent branch needed to be fetched (?). If someone else can explain why this fixed it, I'm all ears.
In the end, i was able to connect, but when trying git push origin master i was getting "fast forward" errors despite the fact that my repo was created with only the default Readme.md. I tried the suggestions in the man pages, but in the end, when my dev folders were pushed to github the folder showed up as green and could not be opened. The git pull --rebase I did also somehow excluded my dev files from my local git repo and i've found no way to add them back.
In the end, i had to create a new github repo and a new local repo. The key in the process is step 3 which pulls the nearly empty (except for Readme.md) repo before attempting to push to it.
I suppose if i didn't accept the dialog box offer to create Readme for repo that 3 would be un-necessary, but it's strange to me that this default option derails the simple repo creation process as elaborated in so many tutorials on the subject.
Why not follow the instructions GitHub gives you?
git remote add origin git@github.com:darkoram/shpero_tracker.git
git push -u origin master
The commands you're issuing are saying "push to the remote repo named origin
the branch named git@github.com:/darkoram/shpero_tracker.git
", which is obviously not correct.
I use
git push origin git@github.com:/darkoram/shpero_tracker.git
I also tried
git push origin https://github.com/darKoram/sphero_tracker.git
both times I get
remote part of refspec is not a valid name in >https://github.com/darKoram/sphero_tracker.git
The solution is to put the branch name at the end of the git command:
git push https://github.com/darKoram/sphero_tracker.git master
Please consider the case (uppercase, lowercase) you are using for those remote addresses:
git remote add origin git@github.com:darKoram/shpero_tracker.git
# NOT:
git remote add origin git@github.com:darkoram/shpero_tracker.git # won't work
# ^^^
# |
See: