如何将github repo的目录更改为其他地方? [英] How to change a github repo's directory to somewhere else?
问题描述
为了避免出现XY问题,这就是发生了什么:
我前几天从Podfile中删除了所有Pod,因为我不再需要它们了。今天,我打开了xcworkspace并查看错误。其中之一是这样的:
lockquote
diff:/../Podfile.lock:没有这样的文件或目录
所以我首先尝试自己解决这个问题。我试过 pod install
, pod update
,还有很多其他的东西。他们都没有工作。所以我想,精美!我会删除所有与cocoapod有关的东西,并再次从头开始!所以我做到了。但问题仍然存在。
pod install
,一切工作都在下载的项目中。 ,我发现github没有跟踪下载项目的变化。它仍在跟踪垃圾中项目的变化。
我需要找到一种方法来更改github当前正在跟踪的项目,以便下载项目。我该怎么做?
我绝对是命令行界面的noob。我不记得所有这些git命令。因此,如果有人可以使用github(Mac)应用程序和CLI显示解决方案,将不胜感激。
我解决了这个问题:
- 创建一个临时文件夹
- 将下载项目的项目文件夹中的所有内容移动到临时文件夹中
- 删除下载项目的项目文件夹,现在为空
- 将已删除的项目从垃圾箱移动到原来的位置,即放回
- 删除原始项目文件夹的内容
- 将临时文件夹中的内容移动到原始项目文件夹中,该文件夹现在为空
- 利润!
To avoid being a X-Y problem, this is what happened:
I removed all the pods from the Podfile a few days ago because I didn't need them anymore. Today, I opened up the xcworkspace and see errors. One of them is this:
diff: /../Podfile.lock: No such file or directory
So I first try to solve the issue myself. I tried pod install
, pod update
, and lots of other stuff. They all didn't work. So I thought, FINE! I'll delete all the cocoapod-related stuff and start from scratch again! And so I did. But the problem is still there.
Then I downloaded the whole project from github and deleted the broken one. I tried updating cocoapods to the newest version and pod install
, everything is working in the downloaded project.
After that, I found out that github is not tracking the changes of the downloaded project. It is still tracking the changes of the project in the trash.
I need to find a way to change the project that github is currently tracking to the downloaded project. How do I do this?
P.S. I am an absolute noob of command line interfaces. I cannot remember all those git commands. So if someone can show the solution both using the github (Mac) app and the CLI, it would be greatly appreciated.
I solved this problem with this:
- Create a temp folder
- Move all the stuff in the downloaded project's project folder to the temp folder
- Delete the downloaded project's project folder, which is now empty
- Move the deleted project from trash to the original position i.e. "Put Back"
- Delete the contents of the original project folder
- Move the stuff in the temp folder into the original project folder, which is now empty
- Profit!
这篇关于如何将github repo的目录更改为其他地方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!