I added a local existing git repo to github.com as a remote via the command
% git remote add origin https://github.com/username/synchm.git
and confirmed it with
% git remote -v
origin https://github.com/username/synchm.git (fetch)
origin https://github.com/username/synchm.git (push)
However when I log into github.com/username the new repository is not visible, not even after and hour.
I tried entering
https://github.com/username/synchm.git
but it redirected to
https://github.com/username/synchm.git
and returned a 404.
What's going on?
You must create the repository trough the github website and then push your local.
What you're doing is merely telling your local git configuration where the origin
remote is located.
After creating the repository on github and setting the origin
remote you still need to push your local branch before it will be visible on github. git push origin master
(replace master with your current branch name).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.