简体   繁体   English

将现有的git repo添加到github.com后,从github.com内部看不到

[英]After adding existing git repo to github.com, not visible from inside github.com

I added a local existing git repo to github.com as a remote via the command 我通过命令将一个本地现有的git repo添加到github.com作为远程

% 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. 但是,当我登录github.com/username时 ,新的存储库不可见,即使在一小时后也不可见。

I tried entering 我试过进去

https://github.com/username/synchm.git

but it redirected to 但它重定向到

https://github.com/username/synchm.git

and returned a 404. 并返回404。

What's going on? 这是怎么回事?

You must create the repository trough the github website and then push your local. 您必须通过github网站创建存储库,然后推送您的本地存储库。

What you're doing is merely telling your local git configuration where the origin remote is located. 你正在做的只是告诉你的本地git配置origin远程所在的位置。

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. 在github上创建存储库并设置origin远程之后,您仍需要在github上显示之前推送本地分支。 git push origin master (replace master with your current branch name). git push origin master (用你当前的分支名称替换master)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM