简体   繁体   English

从github克隆本地存储库后,如何在本地存储库之间切换?

[英]How do I alternate between local repos once I clone them from github?

My title basically says it all. 我的头衔基本上说明了一切。 I have 2 different repos that I would like to work on, I cloned both of them through Terminal, but I can't figure out how to switch back and forth between them. 我有2个不同的仓库,我想通过Terminal克隆它们,但是我不知道如何在它们之间来回切换。 And I don't want to commit a file to the wrong repo. 而且我不想将文件提交到错误的存储库。

I don't want to commit a file to the wrong repo. 我不想将文件提交到错误的存储库。

You won't since the repos have been cloned to two different local folders. 因为存储库已被克隆到两个不同的本地文件夹,所以您将不会。
If the file is in one of those folders, and git add and git commit will be done in the right local repo. 如果文件在这些文件夹之一中,则git addgit commit将在正确的本地存储库中完成。
So to switch from one to the other, simple change your current path to the right folder. 因此,要从一个切换到另一个,只需将当前路径更改为正确的文件夹即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM