简体   繁体   English

如何在同一台Windows计算机上使用具有相同帐户的多个存储库使用GIT

[英]How can I use GIT with multiple repositories with the same account on the same windows machine

I have the first GIT repository (ssh://git@myserver:7999/swlab/java_be_app.git) for a Java Back-End application I developed on one machine and a second GIT repository (ssh://git@myserver:7999/swlab/dotnet_app.git) for a .NET application I developed on another computer. 我有一个在一台机器上开发的Java后端应用程序的第一个GIT存储库(ssh:// git @ myserver:7999 / swlab / java_be_app.git)和另一个GIT存储库(ssh:// git @ myserver:7999 /swlab/dotnet_app.git)用于我在另一台计算机上开发的.NET应用程序。 Yes, I'm using SSH and a "C:/Users/xxxxxxx/.ssh/id_rsa.ppk" file that contains the same key for the same account for both repositories. 是的,我正在使用SSH和一个“ C:/Users/xxxxxxx/.ssh/id_rsa.ppk”文件,其中包含两个存储库的同一帐户的相同密钥。

Now, the second computer crashed: HDD is RIP, memory is fried and CPU with not process anything anymore. 现在,第二台计算机崩溃了:HDD是RIP,内存被炸毁,CPU不再处理任何东西。 And I still need to continue developing both application on one machine. 而且我仍然需要继续在一台机器上开发两个应用程序。 I am using TortoiseGit as my GIT client. 我使用TortoiseGit作为我的GIT客户端。

Merging the 2 repositories into 1 is not an option for so many reasons: these are 2 different applications for 2 different customers and there's also very serious issues of privacy, code and data security. 出于多种原因,将2个存储库合并为1个是不可行的选择:这是针对2个不同客户的2个不同应用程序,并且还存在非常严重的隐私,代码和数据安全问题。

How can I use both repositories, with the same account on the same windows machine? 如何在同一台Windows计算机上使用同一帐户使用两个存储库?

You can create a new repository on the 1st server. 您可以在第一台服务器上创建一个新的存储库。 As I mentioned in my comment, you can have multiple repositories on a server. 正如我在评论中提到的,服务器上可以有多个存储库。

To do this (in TortoiseGIT) you can follow the steps: 为此(在TortoiseGIT中),您可以按照以下步骤操作:

  1. Navigate to the 1st repo server and create a something.git folder (this will be your repository) 导航到第一个仓库,并创建一个something.git文件夹(这将是您的存储库)
  2. Go into the folder, right click and "create new repository" and make sure it's a bare repository. 进入文件夹,右键单击并“创建新存储库”,并确保它是裸存储库。
  3. Clone this onto your machine and then you can add all the files you need and commit it back. 将其克隆到您的计算机上,然后可以添加所需的所有文件并将其提交回来。

Provided that you have the updated version of the git repository that was on the old server, you can also follow this question to migrate the repository onto the new host (you'll still need to follow the steps above to create a repo on the remote). 如果您拥有旧服务器上的git存储库的更新版本,则也可以按照以下问题将存储库迁移到新主机上(您仍然需要按照上述步骤在远程服务器上创建存储库)。

What about ? 关于什么 ?

git clone ssh://git@myserver:7999/swlab/dotnet_app.git git clone ssh:// git @ myserver:7999 / swlab / dotnet_app.git

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

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