fatal: remote error: You can't push to git
last time , when i git push my own github repo, i got this error
fatal: remote error: You can't push to git://github.com/user/repo.git Use https://github.com/user/repo.git
after some googling and reading github help, i found this:
https://help.github.com/articles/pushing-to-a-remote#what-can-i-push-to
that is URL like git://github.com/user/repo.git is read-only, SSH URL like git@github.com:user/repo.git and HTTPS URL like https://github.com/user/repo.git are writeable.
so the solution is pretty simple:
git remote rm origin
git remote add origin git@github.com:user/repo.git
git push origin master
Hope it helps !
Written by fang
Related protips
6 Responses
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/69187/1306cb3c1c4be568ca087de48bc0d967.jpeg)
You do know that GitHub provides all this URLs nicely in the sidebar, right?
@mrfoto, yes i see the repo url is https://github.com/user/repo.git when i not loged in, and git@github.com:user/repo.git when logged in, maybe i cloned the repo using git://github.com/user/repo.git, not copied but by memory, haha
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/3713/12ecd2ec519dec0959f43f193eaca10c.jpeg)
Helped me! I forgot that git:// is read-only, I must have not been logged in when grabbing that URL.
@dideler, :)
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/127669/androbitWW12k.jpg)
thx, good to know!
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/134947/none.jpg)
Awesome
Have a fresh tip? Share with Coderwall community!
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/57823/big_pimpin.jpg)
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/46943/me_180x180.png)