Difference between revisions of "Git svn"

From relax wiki
Jump to navigation Jump to search
Line 100: Line 100:
 
[http://www.tfnico.com/presentations/git-and-subversion Based on these posts] and on [http://trac.parrot.org/parrot/wiki/git-svn-tutorial this recommended post], and [http://john.albin.net/git/convert-subversion-to-git also this post.]
 
[http://www.tfnico.com/presentations/git-and-subversion Based on these posts] and on [http://trac.parrot.org/parrot/wiki/git-svn-tutorial this recommended post], and [http://john.albin.net/git/convert-subversion-to-git also this post.]
  
You need an [[Authors#authors.txt | authors.txt]] file, to correctly convert the metadata.  
+
You need an [[Authors#authors.txt | authors.txt]] file, to correctly convert the metadata.
  git svn clone http://svn.gna.org/svn/relax/trunk --no-metadata -A authors.txt
+
  relax=$HOME\backup\relax
  copy authors.txt trunk
+
relax_disp=${relax}\relax_disp
 +
relax_trunk=${relax}\relax_trunk
 +
GIT_USER_NAME="GIT_USER_NAME"
 +
  mkdir -p ${relax_trunk} ${relax_disp}
  
  git svn clone http://svn.gna.org/svn/relax/branches/relax_disp --no-metadata -A authors.txt
+
  git svn clone http://svn.gna.org/svn/relax/trunk --no-metadata -A authors.txt ${relax_trunk}
  copy authors.txt relax_disp
+
  cp ${relax}/authors.txt ${relax_trunk}
  
  #Build
+
  git svn clone http://svn.gna.org/svn/relax/branches/relax_disp --no-metadata -A authors.txt ${relax_disp}
cd trunk
+
  cp ${relax}/authors.txt ${relax_disp}
scons
 
cd ..
 
  cd relax_disp
 
scons
 
  
 
== Setup remotes to github ==
 
== Setup remotes to github ==
 
=== For branch trunk ===
 
=== For branch trunk ===
  cd C:\WinPython27\relax\trunk
+
  cd $relax_trunk
 
  # If you are a member of the organization, with writing permissions, then do:
 
  # If you are a member of the organization, with writing permissions, then do:
  git remote add origin https://GIT_USER_NAME@github.com/nmr-relax/relax_trunk.git
+
  git remote add origin https://${GIT_USER_NAME}@github.com/nmr-relax/relax_trunk.git
# See the info
 
git remote -v
 
git remote show origin
 
  
 
Now go to github.com at https://github.com/organizations/nmr-relax click '''Repositories -> New'''.<br>
 
Now go to github.com at https://github.com/organizations/nmr-relax click '''Repositories -> New'''.<br>
Line 130: Line 126:
  
 
=== For branch relax_disp ===
 
=== For branch relax_disp ===
  cd C:\WinPython27\relax\relax_disp
+
  cd $relax_disp
 
  # If you are a member of the organization, with writing permissions, then do:
 
  # If you are a member of the organization, with writing permissions, then do:
  git remote add origin https://GIT_USER_NAME@github.com/nmr-relax/relax_disp.git
+
  git remote add origin https://${GIT_USER_NAME}@github.com/nmr-relax/relax_disp.git
# See the info
 
git remote -v
 
git remote show origin
 
  
 
Now go to github.com at https://github.com/organizations/nmr-relax click '''Repositories -> New'''.<br>
 
Now go to github.com at https://github.com/organizations/nmr-relax click '''Repositories -> New'''.<br>

Revision as of 10:55, 23 July 2013

relax branches at github

You should install msysgit on windows, to do the commands.

The relax_trunk

Go to https://github.com/nmr-relax/relax_trunk
Click Fork.

Now add this as a private remote, by setting the remote name hub.

 # Windows
 set relax_trunk="C:\WinPython27\relax\relax_trunk"
 set GIT_USER_NAME="GIT_USER_NAME"
 md %relax_trunk%
 cd %relax_trunk%
 # Linux
 bash ;
 relax_trunk=$HOME\relax\relax_trunk
 GIT_USER_NAME="GIT_USER_NAME"
 mkdir -p ${relax_trunk}
 cd $relax_trunk

 git init 
 # Windows
 git remote add origin https://%GIT_USER_NAME%@github.com/nmr-relax/relax_trunk.git
 git remote add hub https://%GIT_USER_NAME%@github.com/%GIT_USER_NAME%/relax_trunk.git
 # Linux
 git remote add origin https://${GIT_USER_NAME}@github.com/nmr-relax/relax_trunk.git
 git remote add hub https://${GIT_USER_NAME}@github.com/${GIT_USER_NAME}/relax_trunk.git 

 git fetch origin
 git checkout --track origin/master
 git fetch hub
 #Build
 scons

 ## Now we add the user scripts repo
 # Windows
 git clone https://%GIT_USER_NAME%@github.com/nmr-relax/relax_scripts.git
 # Linux
 git clone https://${GIT_USER_NAME}@github.com/nmr-relax/relax_scripts.git

Go to https://github.com/nmr-relax/relax_scripts
Click Fork.

 cd relax_scripts
 # Windows
 git remote add hub https://%GIT_USER_NAME%@github.com/%GIT_USER_NAME%/relax_scripts.git
 # Linux
 git remote add hub https://${GIT_USER_NAME}@github.com/${GIT_USER_NAME}/relax_scripts.git

The relax_disp

Go to https://github.com/nmr-relax/relax_disp
Click Fork.

Now add this as a private remote, by setting the remote name hub.

 # Windows
 set relax_disp="C:\WinPython27\relax\relax_disp"
 set GIT_USER_NAME="GIT_USER_NAME"
 md %relax_disp%
 cd %relax_disp%
 # Linux
 bash ;
 relax_disp=$HOME\relax\relax_disp
 GIT_USER_NAME="GIT_USER_NAME"
 mkdir -p ${relax_disp}
 cd $relax_disp

 git init 
 # Windows
 git remote add origin https://%GIT_USER_NAME%@github.com/nmr-relax/relax_disp.git
 git remote add hub https://%GIT_USER_NAME%@github.com/%GIT_USER_NAME%/relax_disp.git
 # Linux
 git remote add origin https://${GIT_USER_NAME}@github.com/nmr-relax/relax_disp.git
 git remote add hub https://${GIT_USER_NAME}@github.com/${GIT_USER_NAME}/relax_disp.git 

 git fetch origin
 git checkout --track origin/master
 git fetch hub
 ## Now we add the user scripts repo
 # Windows
 git clone https://%GIT_USER_NAME%@github.com/nmr-relax/relax_scripts.git
 # Linux
 git clone https://${GIT_USER_NAME}@github.com/nmr-relax/relax_scripts.git

Go to https://github.com/nmr-relax/relax_scripts
Click Fork.

 cd relax_scripts
 # Windows
 git remote add hub https://%GIT_USER_NAME%@github.com/%GIT_USER_NAME%/relax_scripts.git
 # Linux
 git remote add hub https://${GIT_USER_NAME}@github.com/${GIT_USER_NAME}/relax_scripts.git

How the import to github was done

Based on these posts and on this recommended post, and also this post.

You need an authors.txt file, to correctly convert the metadata.

relax=$HOME\backup\relax
relax_disp=${relax}\relax_disp
relax_trunk=${relax}\relax_trunk
GIT_USER_NAME="GIT_USER_NAME"
mkdir -p ${relax_trunk} ${relax_disp}
git svn clone http://svn.gna.org/svn/relax/trunk --no-metadata -A authors.txt ${relax_trunk}
cp ${relax}/authors.txt ${relax_trunk}
git svn clone http://svn.gna.org/svn/relax/branches/relax_disp --no-metadata -A authors.txt ${relax_disp}
cp ${relax}/authors.txt ${relax_disp}

Setup remotes to github

For branch trunk

cd $relax_trunk
# If you are a member of the organization, with writing permissions, then do:
git remote add origin https://${GIT_USER_NAME}@github.com/nmr-relax/relax_trunk.git

Now go to github.com at https://github.com/organizations/nmr-relax click Repositories -> New.
Call it relax_trunk. We want to preserve history , so do not Initialize this repository with a README or anything like, README or .gitignore.

Then send svn branch master of to github

git push -u origin master

For branch relax_disp

cd $relax_disp
# If you are a member of the organization, with writing permissions, then do:
git remote add origin https://${GIT_USER_NAME}@github.com/nmr-relax/relax_disp.git

Now go to github.com at https://github.com/organizations/nmr-relax click Repositories -> New.
Call it relax_disp. We want to preserve history , so do not Initialize this repository with a README or anything like, README or .gitignore.

Then send svn branch master of to github

git push -u origin master

git operations

Get new changes from svn repository and push to github

git co master
git svn fetch
git rebase --onto remotes/git-svn
git push origin master

See also