Git克隆没有克隆指定的远程仓库

问题描述 投票:0回答:1

最近,当我尝试使用 git bash 将远程存储库克隆到本地计算机时,我出现了一种奇怪的行为,因为它没有克隆指定的远程存储库,而是克隆了我的 Docker 项目存储库之一。 例如: 我使用以下命令克隆远程存储库:

Holyken@HolykenComputer MINGW64 /e/test_repo                                                                            
$ git clone https://github.com/LearningJournal/Kafka-Streams-Real-time-Stream-Processing.git                            
Cloning into 'Kafka-Streams-Real-time-Stream-Processing'...                                                             
remote: Enumerating objects: 26, done.                                                                                  
remote: Counting objects: 100% (26/26), done.                                                                           
remote: Compressing objects: 100% (25/25), done.                                                                        
remote: Total 26 (delta 0), reused 26 (delta 0), pack-reused 0 (from 0)                                                 
Receiving objects: 100% (26/26), 307.43 KiB | 881.00 KiB/s, done.

但是,它克隆了我的 docker 项目。我检查了远程存储库,它返回 3 个原始结果,其中两个指向我的 docker 项目的同一个存储库:

Holyken@HolykenComputer MINGW64 /e/test_repo                                                                            
$ cd Kafka-Streams-Real-time-Stream-Processing/   

Holyken@HolykenComputer MINGW64 /e/test_repo/Kafka-Streams-Real-time-Stream-Processing (master)                         
    $ git remote -v                                                                                                         
    origin  https://holykens:[email protected]/holykens/docker-react.git (fetch)          
    origin  https://holykens:[email protected]/holykens/docker-react.git (push)           
    origin  https://github.com/LearningJournal/Kafka-Streams-Real-time-Stream-Processing.git (push)

我尝试删除所有要再次克隆的源,但它只是删除了存储库 Kafka-Streams-Real-time-Stream-Processing 并且指向我的 docker 项目的源仍然存在。

Holyken@HolykenComputer MINGW64 /e/test_repo/Kafka-Streams-Real-time-Stream-Processing (master)                         
$ git remote remove origin                                                                                                                                                                                                                      

Holyken@HolykenComputer MINGW64 /e/test_repo/Kafka-Streams-Real-time-Stream-Processing (master)                         
$ git remote -v                                                                                                         
origin  https://holykens:[email protected]/holykens/docker-react.git (fetch)          
origin  https://holykens:[email protected]/holykens/docker-react.git (push) 

如何解决此问题以将存储库 Kafka-Streams-Real-time-Stream-Processing 克隆到本地计算机?

谢谢

git github git-clone
1个回答
0
投票

你尝试过吗:

git remote set-url origin git://new.url.here

本期引用了:

如何从 Git 存储库中删除远程源

这个想法是将原点设置为不同的值。

© www.soinside.com 2019 - 2024. All rights reserved.