Last change
on this file since 3428 was
3414,
checked in by afalco, 3 months ago
|
git init in UTIL/ dir + README. AF
|
-
Property svn:executable set to
*
|
File size:
1.2 KB
|
Line | |
---|
1 | # Script to initialize the git repository and link it to the svn. |
---|
2 | # The synchronization requires two pushes |
---|
3 | # (1st push=svn dcommit, 2nd push=git push) |
---|
4 | # WARNING: we assume the svn and the git are up-to-date |
---|
5 | SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) |
---|
6 | cd ${SCRIPT_DIR}/.. |
---|
7 | |
---|
8 | echo "WARNING: this script will setup the git repo" |
---|
9 | echo "or download it in the git-trunk/ folder (and link with git-svn)." |
---|
10 | |
---|
11 | while true; do |
---|
12 | read -p "Do you wish to continue? [y/n] " yn |
---|
13 | case $yn in |
---|
14 | [Yy]* ) break;; |
---|
15 | [Nn]* ) exit;; |
---|
16 | * ) echo "Please answer yes (y) or no (n).";; |
---|
17 | esac |
---|
18 | done |
---|
19 | |
---|
20 | URL=git@gitlab.in2p3.fr:la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk.git |
---|
21 | LOCAL_URL=`git remote get-url origin 2>/dev/null` |
---|
22 | if [ "${LOCAL_URL}" != "${URL}" ];then |
---|
23 | git clone ${URL} |
---|
24 | cd git-trunk |
---|
25 | fi |
---|
26 | |
---|
27 | # link svn to git as git-svn branch |
---|
28 | # (need git-svn to work) |
---|
29 | git svn init https://svn.lmd.jussieu.fr/Planeto/trunk |
---|
30 | |
---|
31 | git update-ref refs/remotes/git-svn refs/remotes/origin/master |
---|
32 | # git svn rebase # not used (we assume we're up-to-date) |
---|
33 | |
---|
34 | # install pre-push hook to ensure |
---|
35 | # users push only commits in sync with svn |
---|
36 | |
---|
37 | ln UTIL/pre-push .git/hooks |
---|
Note: See
TracBrowser
for help on using the repository browser.