Project

General

Profile

Puzzled in Git set-up

Added by krak o'saure about 13 years ago

Hi,

I have been using git with svn for a while. It is working perfectly. I would like to move to git ... and this is where my problems start.
I basically have 2 use cases:
- projects having a repository hosted on github.
- projects having a repository on a remote machine that I manage (for the time being it is the same physical machine as the redmine server).

For 1, I just used created a local repo using

    git clone --mirror git@github.com:git_user/project.git

then if my understanding is correct, I still need to use a cron to fetch all new commits from github using:
git fetch -q --all 

Few questions here: # How can I protect my github password that is automatically asked for the fetch operation ? # Is there a way to do the opposite (keeping the github repo in sync with redmine) ? # Can the project and the repos have different name - I have a problem when they don't have. I can actually see the repository from redmine but cannot clone it on a remote machine.

I am not sure 2/ can be implemented as is because the Settings -> Repository ask me for a

Bare and local repository (e.g. /gitrepo, c:\gitrepo)

So for the time being I am providing a path as /var/git/projectname.git - I do create the repo manually (not using reposman so far because want to choose which type of repo to be created).
mkdir /var/git/projectname.git
cd /var/git/projectname.git
git --bare init
git --bare update-server-info
cp hooks/post-update.sample hooks/post-update
chmod +x hooks/post-update

Here redmine will complain if you look into the repo: The entry or revision was not found in the repository.

Nevertheless a clone will work with a warning:

warning: You appear to have cloned an empty repository.

Adding a file locally, commiting and trying to push lead to:

 git push
Username: 
Password: 
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
Everything up-to-date

I am stuck at this point. Should I enable DAV ? I guess something is wrong with my apache setting.

Redmine 1.2.1.stable (MySQL)
git version 1.7.2.3

<VirtualHost *:80>
     ServerName git.my.domaine

     ServerAdmin xxxx@gmail.com
     DocumentRoot /var/git

     PerlLoadModule Apache::Redmine

     <Directory "/var/git">
         Options None
         AllowOverride None
         Order allow,deny
         Allow from all
     </Directory>

     <Location "/">
         AuthType Basic
         AuthName "Redmine git repositories" 
         Require valid-user

         PerlAccessHandler Apache::Authn::Redmine::access_handler
         PerlAuthenHandler Apache::Authn::Redmine::authen_handler

         ## for mysql
         RedmineDSN "DBI:mysql:database=redmine_default;host=localhost" 

         RedmineDbUser "redmine" 
         RedmineDbPass "password" 
         RedmineGitSmartHttp yes
     </Location>
</VirtualHost>

Thanks