首页 > 解决方案 > Github尝试上传文件并获取一系列错误

问题描述

我正在使用 RStudio,并且我想使用带有 RStudio 的 shell 访问上传许多文件。

我打开我的项目并选择 Git/SVN(在 RStudio 项目选项中)。

原点设置在:git@github.com:msmith01/master_msmith01.github.io.git

我想上传我的所有文件:

> getwd()
[1] "C:/Users/Matt/Documents/msmith01.github.io"

我有以下内容:

> list.files()
 [1] "~$tup Academic site.docx" "="                       
 [3] "config"                   "config.toml"             
 [5] "content"                  "index.Rmd"               
 [7] "msmith01.github.io.Rproj" "public"                  
 [9] "resources"                "Setup Academic site.docx"
[11] "static"                   "themes"

在我运行的 shell 访问中:

PATH=$PATH” C:\Program Files\Git\cmd”

git add .

然后我运行:

git commit -m "myNewUpload"

On branch master
Your branch and 'origin/master' have diverged,
and have 6 and 5 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

nothing to commit, working tree clean

跑步

git pull

我输入一些访问代码并得到以下信息:

Enter passphrase for key '/c/Users/Matt/Documents/msmith01.github.io/=/.ssh/id_rsa':
fatal: refusing to merge unrelated histories

这些文件应替换https://github.com/msmith01/master_msmith01.github.io中的文件

问题是,我上次提交这个 repo 是在 5 个月前,从那以后我做了重大改变,因此我不明白这个错误nothing to commit, working tree clean

标签: gitgithub

解决方案


推荐阅读