【发布时间】:2023-02-01 00:18:46
【问题描述】:
我花了 15 个多小时对 git 进行故障排除,但没有成功。
在过去的 6 个月里,我一直在使用 google drive (G:/) 作为我的本地 git 仓库。我的 github Personal Access Token 已过期,更新后(不幸的是,进行了大量故障排除,重新安装 git、rstudio 和 R),git 不再适用于 google drive。我想我在对我的 github PAT 进行故障排除时在我的计算机上用 git 搞砸了一些东西......
我推断我的问题与 github、R 或 Rstudio 无关,而是与 git 相关。虽然我可以使用 git init 在 C:/ 上的任何位置初始化新的回购协议,但我无法在 G:/ 中的任何地方初始化空白回购协议(我也无法从 github 或 C:/ 克隆)。我在 G:/My 驱动器、git init "G:/My Drive" 和 git init G:/My\ Drive 中尝试过 git init。所有这些都返回错误:fatal: bad config line 3 in file G:/My Drive/np/.git/config(pic)。当我重新运行 git init 并且如果我删除 .git/config 并运行 git init 时,我得到同样的错误。
当我在 G:/ 中使用 git init 时,git./ 中的所有文件(例如,
.git/config、.git/description 和.git/HEAD)被我计算机上其他文件(通常来自 csv 文件)的随机内容损坏。我还暂停了谷歌同步以消除谷歌备份的罪魁祸首。
git config --global -l 返回以下内容:
$ git config --global -l
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=D:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=false
core.fsmonitor=true
pull.rebase=false
credential.helper=manager-core
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master
我从几个 stackoverflow 问题中读到,你不应该使用 google 驱动器(或任何云存储)进行 git,因为它们单独处理每个文件,而不是将 repo 作为一个整体(就像 git 那样)。但是,我的整个工作流程和文件管理都是通过驱动器进行的,而且我的大部分工作都是一个人完成的,所以我更愿意将所有工作集中在驱动器中。
【问题讨论】:
标签: git github google-drive-api