Git 克隆从其他项目复制一些文件



我已经分叉了一个存储库,并在这样做之后尝试克隆它

$ git clone https://github.com/dax/newly_cloned_project.git

克隆成功:

Cloning into '[newly_cloned_project]'...
remote: Counting objects: 180, done.
remote: Compressing objects: 100% (143/143), done.
remote: Total 180 (delta 57), reused 144 (delta 21)
Receiving objects: 100% (180/180), 206.54 KiB | 268 KiB/s, done.
Resolving deltas: 100% (57/57), done.

但是当将目录更改为newly_cloned_project时,我会看到以下内容:

You are using '.rvmrc', it requires trusting, it is slower and it is not compatible with other ruby managers,
you can switch to '.ruby-version' using 'rvm rvmrc to [.]ruby-version'
or ignore this warning with 'rvm rvmrc warning ignore /Users/charliekim/programming/developer application tasks/connect_four/.rvmrc',
'.rvmrc' will continue to be the default project file in RVM 1 and RVM 2,
to ignore the warning for all files run 'rvm rvmrc warning ignore all.rvmrcs'.

我正在为其他项目使用.rvmrc文件 - 但这是新创建的并且没有这样的文件 - 经过仔细检查,事实证明我的newly_cloned_project目录中有相当多的文件 - 包括一个.rspec文件和随附的spec目录...

我环顾了 SO 和 Google,但没有看到任何对此的引用 - 我已经三重检查了我的克隆过程,所以那里没有问题(我可以告诉? 真的不确定发生了什么!

愚蠢的错误

- 如果其他人遇到这样的问题,请务必检查您是否没有对用户级别gitconfig文件(在 Unix 系统上的 ~/.gitconfig 中找到)进行不必要的更改。

我在此文件中为特定存储库添加了远程,这导致了问题。

~/.gitconfig

[remote "origin"]
    url = [email_address]:dax/other_repo.git
    fetch = +refs/heads/*:refs/remotes/origin/*

应该在.../other_repo/.git/config

最新更新