Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Transport Error: Cannot get remote repository refs. file:// ... not found(Error attempting to configure Push Reference Specifications)
Transport Error: Cannot get remote repository refs. file:// ... not found [message #1855488] Mon, 17 October 2022 18:43 Go to next message
Eclipse UserFriend
Using EGit, I've created my local repository and am attempting to set up a remote repository on a backup drive using the file protocol. I'm able to see thet the remote repository file:///D:\git\remote\repository\leaguetracker\.git has been created, but when I attempt to establish the push configuration I receive the error shown in the attach screen shot.
Re: Transport Error: Cannot get remote repository refs. file:// ... not found [message #1855505 is a reply to message #1855488] Tue, 18 October 2022 14:54 Go to previous messageGo to next message
Eclipse UserFriend
Does it work if you use forward slashes instead of backslashes?
Re: Transport Error: Cannot get remote repository refs. file:// ... not found [message #1855529 is a reply to message #1855505] Wed, 19 October 2022 13:29 Go to previous messageGo to next message
Eclipse UserFriend
No. I tried that too just for the heck of it but I knew that was a long shot and that I was just grasping at straws. If you go through the configuration wizard to Create Remote ... you are presented with the dialog shown in the attached create-remote.jpg screenshot.

In this dialog I selected the Local Folder ... option and navigated to the directory where I want the remote repository to be created. The wizard filled in the URI specification from the path I navigate to and I didn't have to enter enter slashes or back slashes ... the wizard did this for me. So, I'm thinking the wizard knows best what it is doing for the Windows platform that I am on. Notice that it fills the file protocol as well so I'm thinking it knows what it's doing there as well.

This was pretty straightforward and appears to be correct as I was able to use the git remote command to verify that the remote file repository was indeed created (see the created-repository.jpg screenshot).

I then try to setup the push specification and use the Advanced dialog to do that. This results in the error that I'm getting right away when clicking into that dialog (see advanced-push-dialog.jpg).

It's hard to get a handle on what I might be doing incorrectly since I'm just using all the EGit dialogs and wizards to set things up. I'm tempted to submit a bug report but didn't want to do that until I submitted a community post first. If this is looking like a bug to anyone else with more experience with EGit that I have, please let me know and I'll go down that route next.

Thanks
Re: Transport Error: Cannot get remote repository refs. file:// ... not found [message #1855532 is a reply to message #1855529] Wed, 19 October 2022 13:50 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
... attempting to set up a remote repository on a backup drive...

Quote:
... directory where I want the remote repository to be created.


Now I see. You do have a repository, and want to duplicate it somewhere else in your file system. Sorry that I missed that on first reading.

Your steps won't work for that.

First off, git is not a backup tool. You're far better served by a real backup solution.

But if you want to do that, then create an empty repo on that backup drive first. Then set the push remote to that repo (and perhaps configure the push refspecs), then push.

What if your backup drive fails? Perhaps consider using a private Github repository instead. Create the repo on Github first, install an SSH key (or create a Personal Access Token with appropriate scope if you want to use HTTPS; use the PAT then as password), then set the push URL to point to that Github repo, and push. Of course it doesn't have to be Github, choose any git server provider you like. The basic steps are the same.



Re: Transport Error: Cannot get remote repository refs. file:// ... not found [message #1855568 is a reply to message #1855532] Thu, 20 October 2022 13:33 Go to previous messageGo to next message
Eclipse UserFriend
Thomas,

Firstly, thanks for taking the time to reply to my post. I should not have said "a backup drive" as that implied that I was trying to create a backup of my projects. That is certainly not what I was intending. I do understand that a Version Control System is much different than a backup system. I do backup my projects on a daily basis, but that doesn't provide the same features as a version control system and that is what I was looking to use to version my various project artifacts.

In the end I will probably use GitHub as a remote repository, but being new to Git I first wanted to use it locally for a while to get use to it. I've used several different version control systems in the past and each one has their peculiarities, terminology, and idiosyncrasies. Once I'm comfortable with how Git and EGit works I'll consider using a Git server like GitHub for a remote repository.

All that said, I did finally find the step I was missing after reading the content of this link: https://en.wikibooks.org/wiki/Git/Repository_on_a_USB_stick ... and that was as follows:

1. I first created a remote repository directory on my external USB drive:
mkdir D:\git\remote\repository

2. I then CDed into that directory and entered the follwing GIT command:
git clone --bare c:\wamp64\www\leaguetracker leaguetracker

I had already set up Git in my c:\wamp64\www\leaguetracker project directory and added all the appropriate .gitignore specifications to my base directory so that only the artifacts (files) files I wanted saved to my repository were in order. This clone command shown above appeared to create a Git repository in the D:\git\remote\repository\leaguetracker directory and populated that repository with the contents of my leaguetracker project, minus all the .gitignore files. To test that the "bare" remote repository was in order, I created a dummy directory on my c: drive and cloned the directory from the D:\git\remote\repository\leaguetracker repository I just created:

c:
md C:\wamp64\www\testclone
git clone D:\git\remote\repository\leaguetracker

I was able to confirm that the C:\wamp64\www\testclone directory now contained a leaguetracker directory populated with the content of my original project, minus the .gitignore files.

3. I now went back to my original project and could use the various EGit dialogs to create a remote repository, point it at the D:\git\remote\repository\leaguetracker directory, and create all the appropriate Push and Fetch specifications correctly.

I'm now able to push and fetch as necessary to/from the remote repository as required. So essentially, it appeared that the only step I missed was the --bare clone of my project into the remote repository. I believe this was what you said too in your reply, but when you are new to a particular piece of software, it's not intuitively obvious what "create an empty repo on that backup drive first" actually means and how to do it.

Thanks again for your reply!

Regards
Re: Transport Error: Cannot get remote repository refs. file:// ... not found [message #1855575 is a reply to message #1855568] Thu, 20 October 2022 14:55 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
... it's not intuitively obvious what "create an empty repo on that backup drive first" actually means and how to do it.

:-) Sorry about that. Would have been as simple as running git init or git init --bare.

Quote:
... minus the .gitignore files

So they were probably not committed yet in the original repository? (Or did you mean "minus the files ignored by .gitignore"? That would be as it should be.)
Re: Transport Error: Cannot get remote repository refs. file:// ... not found [message #1855587 is a reply to message #1855575] Fri, 21 October 2022 11:20 Go to previous messageGo to next message
Eclipse UserFriend
Yes ... minus the files ignored/specified in the .gitignore file ... as expected.

It's a Symfony 4 project where I am currently using Symfony 4.2 libraries that I want to upgrade to Symfony 6+. Along the way I'd like to snapshot working versions of the project at 4.2, 4.4., 5.4, and 6.x. There are quite a few steps and changes to source files that I need to make in these upgrades. My thinking is that if I totally mess something up in a step that I could restore back to a working point and try again, and I was hoping that I could use Git to manage that.

Eventually, I'd also like to contribute the project to the open source community. I have it deployed at httsp://premiergolfleaguetracker.com and when I do contribute it, it seems logical to just do that in a GitHub repository.

I'm still working my way through Git training. But at least now I have one of my projects in a state where I can experiment with it locally without having to establish a GitHub account.

Thanks again for your replies! It's humbling to be ignorant ... lol ... and it's nice to have help to get you through it.

Regards
Re: Transport Error: Cannot get remote repository refs. file:// ... not found [message #1855590 is a reply to message #1855587] Fri, 21 October 2022 15:22 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
Along the way I'd like to snapshot working versions of the project at 4.2, 4.4., 5.4, and 6.x.

git is the perfect tool for this; no "backup" remote repository needed. (Though having one won't hurt.) Just commit regularly during this work. When you mess something up, you can always revert to an earlier commit's state for a new attempt. And if you tag the commits of the versions working at 4.2, 4.4., 5.4, and 6.x, you can also easily check out those states at any time.
Re: Transport Error: Cannot get remote repository refs. file:// ... not found [message #1856440 is a reply to message #1855590] Fri, 09 December 2022 18:40 Go to previous message
Eclipse UserFriend
Note that if you clone a repository using a local absolute or relative path this implies the --local
option [1] which means the clone will hardlink the files under .git/objects/ instead of copying them
from the source repository.
Use the --no-hardlinks option or the file:// protocol instead if you want to avoid that.

[1] https://git-scm.com/docs/git-clone#Documentation/git-clone.txt--l
Previous Topic:EGit - Windows Share as Remote Repository Over SSH
Next Topic:How to install egit Mylyn Github Connector?
Goto Forum:
  


Current Time: Sun May 18 16:52:21 EDT 2025

Powered by FUDForum. Page generated in 0.04279 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top