본문 바로가기
CI CD/Git:GitHub

fatal: remote error: You can't push to git

by 신군. 2018. 9. 30.
반응형

fatal: remote error: You can't push to git

GITHUB

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 !



반응형