git - 致命 : Could not read from remote repository. Github 错误:无法将某些引用推送到

标签 git github git-bash

尝试使用 Git bash 添加一个很大的 csv 文件。我已经克隆了存储库,它也存在于我的 git bash 中,并且它以名称 origin 存在。但是我无法将 csv 文件推送到原点。

将 Filename.csv 推送到我的 github 的代码。下面的代码工作正常。

$ git push origin master
$ cd path_of_directory
$ git lfs install
$ git lfs track "*.csv"
$ git add Filename.csv
$ git commit -m "Filename.csv"
$git remote add origin 'https://github.com/Shailaja-Gupta/Marketing-and-Sales-Machine-Learning.git'
$git remote
origin

有问题的代码

$ git push origin master
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

用 https 链接替换 ​​origin 会出现以下错误:

$ git push 'https://github.com/Shailaja-Gupta/Marketing-and-Sales-Machine-Learning.git' master
--->ref master:: Error in git rev-list --stdin --objects --not --remotes=https://github.com/Shailaja-Gupta/Marketing-and-Sales-Machine-Learning.git --: exit status 128 fatal: bad object 3cc9272e299e6c7a9cbfe02b36060691f7f86b17

error: failed to push some refs to 'https://github.com/Shailaja-Gupta/Marketing-and-Sales-Machine-Learning.git'

最佳答案

以下步骤对我有用:

$git init
$git add .
$git commit -m 'message'
$git remote add origin 'https://github.com/Shailaja-Gupta/Marketing-and-Sales-Machine-Learning.git'
$ git pull --rebase origin master
$ git push origin master

这对我有用

关于git - 致命 : Could not read from remote repository. Github 错误:无法将某些引用推送到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61042354/

相关文章:

unix - 如何查看所有命令的日志?

Git merge 提交未在 Git/SourceTree 中显示为 merge

git - 无法使用 SSH 克隆 GitHub 存储库

bash - 如何从 Gitlab 下载私有(private)存储库而不暴露 url 中的访问 token ?

将用户添加到存储库时触发 Github 操作

git - 在什么情况下,在分支中进行一些文件更改后无法切换到另一个分支?

在后台启动 gitk 和 git gui 的 git 别名

Git:如何比较工作目录中的文件与早期提交中的相同文件?

git - 如何将没有点的文件(所有无扩展名的文件)添加到 gitignore 文件?

svn - Git: merge 两个不同的独立 repo