I was getting the blow error when setting up a git repository under a Redmine project. I had two separate issues that I will explain below.
Redmine Error: The entry or revision was not found in the repository.
The first issue on this server was an incorrect version of git. I was aware that Redmine required git version 1.5.4.2 or above. So when I initially checked the server I saw git version 1.6.0.2 however I later noticed that git had been installed from source as well as installed via yum. The latest version available via yum was git version 1.5.2.1 and the user that was running Redmine happened to be usign the older version. Once this issue was resolved I still had the same error showing up under a Redmine Project’s Repository tab so there was another issue.
The second issue was the fact that Redmine was looking for git in /usr/bin and the source install of git had been installed in /usr/local/bin. So Redmine assumed git was not installed because it could not find it. This is an easy fix by adding a symbolic link to the correct version. Issue the command below to resolve the issue.
- ln -s /usr/local/bin/git /usr/bin/git
The above will create a symbolic link that will run /usr/local/bin/git any time /usr/bin/git is issued as a command. Once I resolved both of these errors I was able to see the git repository from the Redmine interface.
You may also receive this error if the local git repository does not exist. So double check you have typed in the path to your git repository properly.
if all else fails, edit your lib/redmine/scm/adapters/git_adapter.rb
make the GIT_BIN variable point to the absolute path of your git executable
before :
GIT_BIN = “git”
after:
GIT_BIN = “/home/yourname/bin/git”
ofcourse the absolute path of your git executable is going to be different that what i’ve mentioned.
to find your git path type in “which git”
Hello colorfulgrayscale,
Thanks for taking the time to post this info. We appreciate any and all feedback that provides data like this.
Thanks.
alex
I have installed GIT in a different path “/usr/local/src/git-1.7.3/git” and when i use the command “which git” i get the path “usr/local/bin/git”
So when i try to use the ln -s command i get “file exists ” message , the GIT is running fine but the issue is that the redmine is not fetching the files from the repo.
Also i have set the GIT_BIN to GIT_BIN = “/usr/local/bin/git”
Also pointing /usr/local/bin/git to /usr/local/src/git-1.7.3/git effect my other git settings?
Hello Gaurab,
It sounds as if the source for git was downloaded to /usr/local/src and just because you compiled it in that directory when you actually installed the package it moves the executable to the proper directory usually so the actual git command is more than likely in /usr/local/bin. You can verify this by first changing directory into /usr/local/bin by typing “cd /usr/local/bin” and then by typing “ls -alh | grep git”. This will show you if the file actually exists in that directory or if it is a symbolic link to a different location. Also verify your git version by typing “git –version” from the command line.
I am not sure what you mean by “file exists” message.
As for your last question I am not sure exactly what you mean. It sounds as if you are making a statement versus asking a question. What issue exactly are you having? What error is provided when you attempt to manually sync with the git repo? What errors are displayed in the redmine logs or any other logs that may produce some output to pinpoint the issue?
Thanks.
alex
Thanks alex for the reply.
I tried the command you have mentioned, as you pointed out i just kept the git files in “/usr/local/src” but after compiling the git settinngs seems to be fine.
There exists git file in the location usr/local/bin/ so i think that portion is done.
Also git –version also throws the correct git version i have installed that is 1.7.3 and
ls -alh | grep git also shows the git file.
Also i have added the line “usr/local/bin/” to the git adapter file.
But that also doesn’t help when i click in the repository tab in the redmine application it again gives the “The entry or revision was not found in the repository.” error.
Any thing else iam missing , please do suggest me
Thanks
Hello Gaurab,
Did you ever follow the instructions in the article by creating the symbolic link to /usr/bin/git? Have you looked in the logs to see if there is anymore information?
Thanks.
alex
Hello there,
I’ve try lot of thing but nothing work for me i have always the 404 repository not found in redmine for a git
my git version is 1.7.0.4
git is in /usr/bin/git
i’ve set GIT_BIN to this binary
i’ve used reposman for bare repo creation
i’ve succesffuled clone, add a file, commit, pushed to those repo
when i clone it again i’ve got my new file
i’ve tryed to ruby script/runner “Repository.fetch_changesets” -e production
but redmine repository tab still not found my repo
I don’t understand what i do wrong !
Hello Symio,
Unfortunately the logging to let you know details about the issue are not the best. Is the git repo located in the redmine project directory and does it have the proper permissions for the user that runs the redmine ruby project to view/modify it?
Thanks.
alex
Thanx for you’re answer.
Finally I’ve remade the installation from scratch and it run’s now.
Don’t know why ! I surely have missed a point at the first install.
Hello Symio,
Good to hear! Thanks for letting us know that you got it resolved!
Thanks.
alex