I have a java project that used to deal with a remote repository that now doesn't exist any more. It has a history I'd like to keep and I need to create another remote bare repository where push to and pull from, for the future commits. How can I do this, just starting from the only copy I have now, the local one (which is already some commits ahead)?
Asked
Active
Viewed 1,459 times
0
-
1Possible duplicate of [Change the URI (URL) for a remote Git repository](http://stackoverflow.com/questions/2432764/change-the-uri-url-for-a-remote-git-repository) – 1615903 Nov 11 '16 at 10:54
-
Please refer the link: http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/ – kk. Nov 11 '16 at 10:55
-
It's not a duplicate. I have no repositories where I need to create a new one and the old bare remote repository is lost. Moreover, I need to know how to do it without using git shell, but only via eclipse. – SamCle88 Nov 11 '16 at 11:28
1 Answers
1
Eclipse has a Git Perspective that helps you achieve this.
Head over to Window -> Open Perspective -> Other
and choose Git
from the dialog
You would be presented with the Git Repository
view.
Expand the Remotes section, and Click on Create Remote...
Fill in the details of your new repository.
You can then choose to remove the previous remote and rename the newly created one as origin.

Avin D'Silva
- 330
- 3
- 9
-
How can I fill in the details to make eclipse create the new repository where I need it to be? – SamCle88 Nov 14 '16 at 09:19
-
-
Yes, I'm talking about remote repo. The last one was in a usb pen that now deosn't work any more. – SamCle88 Nov 16 '16 at 15:52
-
Why do you even have a remote repository on a USB? The whole point of a remote is for collaboration. Create a bare repository on some server which all contributors can access or use git hosting solutions like GitHub/GitLab/BitBucket. Gitlab even provides you with unlimited private repos without a limit on contributors. – Avin D'Silva Nov 17 '16 at 07:10
-
I have it on a usb because I needed something (not too important) to practice on with git and I needed it because I can work on it both with my pc at work and at home. – SamCle88 Nov 17 '16 at 09:26
-
@SamCle88, Then I guess, Github or GitLab is the perfect solution to your problem. They provide you will free accounts to start with and this is the most popular way to work with git. I would advise you to follow this method and this will the way you will be using git moving forward. But, if you can't access any of these solutions outside your workplace, then it is a blocker. You will have to follow creating your remote on your USB :(. If you are going with this, I am afraid, you can't create bare repositories using eclipse. You will have to fall back to the command line. – Avin D'Silva Nov 17 '16 at 12:20