I executed Repository.fetch_changesets using script/runner by cron to synchronize repositories of Redline with Git and I got an error below.
git: not found
I modified redmine/lib/redmine/scm/adapters/git_adapter.rb like below and it became OK.
#GIT_BIN = "git"
GIT_BIN = "/usr/local/bin/git"
※ On r4795, r4797, you can set scm_git_command to the path to Git in configuration.yml, so you no longer need such modification like above.
I also encountered an onother problem.
When the user who executes Redmine does not have permission for the Git repository directory (like xxx.git), Redmine shows "The entry or revision was not found in the repository." error on repository page.
Workaround is:
$ sudo chmod o+rx xxxx.git
- If the repository is in a user's home directory (e.g. on gitosis or gitolite), you also have to do chmod o+x for the user's home directory.