I have set up a gitstack repo on a local server, I have also signed up for a free github account just to see what its like.
But when I try to clone a repository from either my local repository or git hub repository I get this error:
Transport Error
Cannot List the available branches
Reason:
Exception caught during execution of ls-remote command
What does this mean and how do i go about solving this problem?
After having this problem with Egit I went back to using GitBash to try to create, push and pull repositories. I was then given this error:
Git Bash error:
fatal: http://xx.xx.x.xxx/mjtest.git/info/refs not found: did you run git update-server-info on the server?
Egit error:
Transport Error
Cannot List the available branches
Reason:
Exception caught during execution of ls-remote command
I found that the solution to both the GitBash and the Egit error was to create an empty file called git-daemon-export-ok
and place it directly into the xxxx.git
root directory of the repository on the server.
The solution explained:
I set up a repository in gitstack called mjtest
and create myself a new username and password and add myself to the repository with read and write access.
This is what I then do in GitBash:
I set up my local repo:
git config --global user.name "XXXXXXXX"
git config --global user.email XXXXXXXX
mkdir ~/mjtest
cd ~/mjtest
git init
touch README
Then I create the empty file:
touch git-daemon-export-ok
So now we have a local repository that has a file called README
and our git-daemon-export-ok
file in it.
We now need to copy the git-daemon-export-ok
file and place it directly into the mjtest.git
folder in the server.
Once that is done the git-daemon-export-ok
file can be deleted from the local repository, as it just needs to be on the server.
Adding, Commiting and Pushing:
git add README
git commit -m 'first commit'
git remote add origin http://XX.XX.X.XXX/mjtest.git
git push origin master
This should work and you should be able to go onto your gitstack server and see your first commit.
I then went back onto Egit and cloned the http://XX.XX.X.XXX/mjtest.git
repository and it worked.
Now both push and pull work in GitBash and Egit!