I've pushed before without problems. Just don't know what I'm doing wrong here.
I got a little further. Followed the instructions by marshall and the generating-ssh-keys link below, but still get
git push -u origin master ERROR: Repository not found. fatal: The remote end hung up unexpectedly
I've established that my ssh keys are good and verified that they exist on github by tring to add what's in my id_rsa.pub to my github (it said the key already existed).
$ ssh -T git@github.com Hi darKoram! You've successfully authenticated, but GitHub does not provide shell access.
ssh -T -p 443 git@ssh.github.com The authenticity of host '[ssh.github.com]:443 ([207.97.227.248]:443)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '[ssh.github.com]:443,[207.97.227.248]:443' (RSA) to the list of known hosts. Hi darKoram! You've successfully authenticated, but GitHub does not provide shell access
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.
The error refers to the fact that you're not using a valid refspec. A refspec takes the following form (items in [] are optional, and items in are parameters):
[+][:]
In the format above, both the source and the destination are references, and branches in Git are references, so you can use branches as refspecs. For example, the following are both valid and equivalent refspecs:
git@github.com:/darkoram/shpero_tracker.git is not a vaid reference/branch, it's the URL for your remote repo. That's probably why Git is complaining that the refspec is not valid.
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.
create github repo
git add remote origin (https://... the url in the window on github page)
git clone origin master
create local repo; add; commit;
git push origin
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.
回答6:
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.