Ruby on rails 无法推送某些引用

Ruby on rails 无法推送某些引用,ruby-on-rails,github,push,Ruby On Rails,Github,Push,我正试图推到github 我遵循以下步骤: (在这些行之前,Im位于我的应用程序目录中) (我不知道那条消息是否有误) 但我总是有同样的问题,因为我打字晚了,所以我犯了下一个错误 To git@github.com:asantoya/estaciones.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@github.com:asantoya

我正试图推到github 我遵循以下步骤: (在这些行之前,Im位于我的应用程序目录中)

(我不知道那条消息是否有误)

但我总是有同样的问题,因为我打字晚了,所以我犯了下一个错误

To git@github.com:asantoya/estaciones.git
! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:asantoya/estaciones.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.  See the
'Note about fast-forwards' section of 'git push --help' for details.

这意味着远程存储库已经有一个主分支,并且该分支中有自您提交本地副本以来添加的内容。这是指在上可见的代码

首先从github克隆repo,然后向其添加更改,然后推送:

git clone https://github.com/asantoya/estaciones.git
git checkout -b nameofyourbranch master
添加一些文件等

git commit -a -m "Your commit message"
git push origin nameofyourbranch

如果要添加所有文件,命令是:“git add.”rigth?如何替换现有文件和目录?是的,“git add.”将添加所有文件和目录。如果要擦除github文件并重新开始,可以删除,然后重新创建该存储库,但会丢失历史记录。否则,在克隆repo后(通过使用git-rm)在本地删除所有文件,然后添加所需的文件,提交并推送。
git clone https://github.com/asantoya/estaciones.git
git checkout -b nameofyourbranch master
git commit -a -m "Your commit message"
git push origin nameofyourbranch