Difference between revisions of "Git svn"

From relax wiki
Jump to navigation Jump to search
Line 46: Line 46:
 
Now add this as a private remote, by setting the remote name '''hub'''.
 
Now add this as a private remote, by setting the remote name '''hub'''.
 
  git remote add hub https://GIT_USER_NAME@github.com/GIT_USER_NAME/trunk.git
 
  git remote add hub https://GIT_USER_NAME@github.com/GIT_USER_NAME/trunk.git
 
Now fetch changes from remote hub
 
git fetch origin
 
git fetch hub
 
git branch -a
 
 
We now change to your hub branch
 
git co hub/master
 
See the log messages with
 
gitk
 
Merge in, the svn master branch
 
git merge master
 
git log
 
gitk
 
We need to make a setting [http://stackoverflow.com/questions/948354/git-push-current-branch how we push branches.]
 
git config push.default simple
 
 
Then send it of to github
 
git push hub
 
  
 
==== For branch relax_disp ====
 
==== For branch relax_disp ====
Line 79: Line 60:
 
  git remote add hub https://GIT_USER_NAME@github.com/GIT_USER_NAME/relax_disp.git
 
  git remote add hub https://GIT_USER_NAME@github.com/GIT_USER_NAME/relax_disp.git
  
 +
==== git operations ====
 
Now fetch changes from remote hub
 
Now fetch changes from remote hub
 
  git fetch origin
 
  git fetch origin
Line 84: Line 66:
 
  git branch -a
 
  git branch -a
  
We now change to your hub branch
+
We need to make a setting [http://stackoverflow.com/questions/948354/git-push-current-branch how we push branches.]
  git co hub/master
+
  git config push.default simple
See the log messages with
+
 
  gitk
+
First get the latest changes from remote
 +
git pull hub master
 +
git log
 +
 
 +
Then send svn branch master of to github
 +
  git push hub master
  
 
== See also ==
 
== See also ==
 
[[Category:git]]
 
[[Category:git]]

Revision as of 22:46, 21 July 2013

Background

Windows

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

You should install msysgit, to do the checkout.

md C:\relax
cd C:\relax

To clone from a revision number, use -r NR. This will tell which revision to start taking history from. If you want to include all of the history, just leave that option off, but it will take a very long time, and you really don't need all of it. The older a revision you choose, the longer it will take to import. But you will not be able to "git blame" past the earliest revision you import.

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

git svn clone http://svn.gna.org/svn/relax/trunk --no-metadata -A authors.txt
git svn clone -r 20000:HEAD http://svn.gna.org/svn/relax/trunk --no-metadata -A authors.txt
git svn clone http://svn.gna.org/svn/relax/branches/relax_disp --no-metadata -A authors.txt
git svn clone -r 20000:HEAD http://svn.gna.org/svn/relax/branches/relax_disp --no-metadata -A authors.txt
#Build
cd trunk
scons
cd ..
cd relax_disp
scons

For futurev updates to the SVN revision HEAD, you now need to do a git svn rebase, which is very similar to: svn up

git svn rebase

Check branch information

git branch -a

Add remotes to github

# Add trunk as origin repository, from the github nmr-relax organization.

Setup remotes to github

For branch trunk

cd C:\relax\trunk
git remote add origin https://github.com/nmr-relax/trunk.git
# 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/trunk.git
# See the info
git remote -v
git remote show origin

Now go to github.com at https://github.com/nmr-relax/trunk and click Fork.
Now add this as a private remote, by setting the remote name hub.

git remote add hub https://GIT_USER_NAME@github.com/GIT_USER_NAME/trunk.git

For branch relax_disp

cd C:\relax\relax_disp
git remote add origin https://github.com/nmr-relax/relax_disp.git
# 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
# See the info
git remote -v
git remote show origin

Now go to github.com at https://github.com/nmr-relax/relax_disp and click Fork.
Now add this as a private remote, by setting the remote name hub.

git remote add hub https://GIT_USER_NAME@github.com/GIT_USER_NAME/relax_disp.git

git operations

Now fetch changes from remote hub

git fetch origin
git fetch hub
git branch -a

We need to make a setting how we push branches.

git config push.default simple

First get the latest changes from remote

git pull hub master
git log

Then send svn branch master of to github

git push hub master

See also