Project

General

Profile

HowTo keep in sync your git repository for redmine » History » Version 2

Jim Mulholland, 2009-05-19 17:32

1 1 Thomas Lecavelier
h1. HowTo keep in sync your git repository for redmine
2
3
Here an HowTo written by Farzy ("Farzad FARID":http://www.pragmatic-source.com/) on how to keep two git repositories syncronized
4
5
* "Automatic synchronization 2 git repositories [en]":http://www.pragmatic-source.com/en/opensource/tips/automatic-synchronization-2-git-repositories
6
* "Synchronisation automatique de deux référentiels git [fr]":http://www.pragmatic-source.com/fr/opensource/tips/synchronisation-automatique-de-deux-referentiels-git
7 2 Jim Mulholland
8
*Summary Of Above Blog Post*
9
10
_In the below example, "git_user" and "project.git" should be modified for your GitHub project_
11
<pre>
12
git clone --bare git@github.com:git_user/project.git project.git
13
cd project.git
14
git remote add origin git@github.com:git_user/project.git
15
git fetch -v
16
git fetch origin
17
git reset --soft refs/remotes/origin/master 
18
</pre>
19
20
_In this cron script, "app" is the owner of the project.git directory_
21
<pre>
22
sudo vi /etc/cron.d/sync_git_repos
23
# One-way synchronization of a local and remote bare Git repository.
24
# Repeat this line for each repository.
25
*/5 * * * * app cd /path/to/project.git && git fetch origin && git reset --soft refs/remotes/origin/master > /dev/null
26
</pre>