首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在Github中推送新代码的问题

在Github中推送新代码的问题
EN

Stack Overflow用户
提问于 2014-01-06 05:51:42
回答 10查看 203.8K关注 0票数 149

我在Github上创建了一个新的存储库,现在只有Readme.md文件。

我有一个新创建的RoR项目,我想将其推送到此存储库。以下是我在终端中给出的执行此命令的命令,以及我收到的错误。

代码语言:javascript
复制
git remote add origin https://github.com/aniruddhabarapatre/learn-rails.git

然后我输入了我的用户名和密码

代码语言:javascript
复制
git push -u origin master

错误--

代码语言:javascript
复制
To https://github.com/aniruddhabarapatre/learn-rails.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/aniruddhabarapatre/learn-rails.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first merge the remote changes (e.g.,
hint: 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

这是我第一次将我的代码推送到Github存储库,我对这些错误感到迷惑。我搜索了这里提出的其他几个问题,但它们都没有第一次出现问题。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20939648

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档