0

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. 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.

Now, the second computer crashed: HDD is RIP, memory is fried and CPU with not process anything anymore. And I still need to continue developing both application on one machine. I am using TortoiseGit as my GIT client.

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.

How can I use both repositories, with the same account on the same windows machine?

Binyamin Regev
  • 914
  • 5
  • 19
  • 31
  • Nothing stops you from having 2 repositories hosted on one machine... You can just make another repository on your first machine, and import the repo that you want into it. Though, if you're trying to preserve the branch history then you'll need to acquire it and put it on the machine too. – px06 Sep 27 '16 at 15:31
  • Cool that I can do that, but **how?** Can I do this in _TortoiseGit_, or have to use commandline? I am not familiar with GIT command-line instructions. – Binyamin Regev Sep 27 '16 at 15:37
  • I fail to see what prevents you from using two git repos on the same machine. Can you expand upon how you are prevented from doing what you want? – andrel Sep 27 '16 at 18:42
  • I am not prevented - I don't know how to do it, always worked with 1 repository. And always used a client like _TortoiseGit_ or something similar. – Binyamin Regev Sep 28 '16 at 06:51

2 Answers2

0

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:

  1. Navigate to the 1st repo server and create a something.git folder (this will be your repository)
  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).

Community
  • 1
  • 1
px06
  • 2,256
  • 1
  • 27
  • 47
-1

What about ?

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