Please consider the attached steps which create an SVN repo and setup git 
to track it.

1. Why do "local-newbranch" and "master" not share a common ancestor?

2. How do I make them share a common ancestor?

3. Assuming (2) is possible, will I be able to rebase "master" changes onto 

4. Assuming (3) is possible, will I be able to dcommit "local-newbranch"?

Thank you,


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

# Init and create SVN repo
cd ${ROOT}
rm -rf repo.git/ repo.svn svn-repo-checkout/
svnadmin create repo.svn
svn checkout file://${ROOT}/repo.svn svn-repo-checkout
cd ${ROOT}/svn-repo-checkout/
mkdir trunk
echo "line 1" > trunk/a.txt
svn add trunk/ branches/
svn commit -m "Initial commit"
echo "line 2" >> trunk/a.txt
svn commit -m "Added a second line"

# Create a GIT repo that follows the SVN trunk
cd ${ROOT}
git svn clone file://${ROOT}/repo.svn/ --trunk=file://${ROOT}/repo.svn/trunk/ 

# Create the SVN branch
cd ${ROOT}/svn-repo-checkout
svn cp --parents file://${ROOT}/repo.svn/trunk/ 
file://${ROOT}/repo.svn/branches/newbranch -m "Created a branch newbranch"
svn up

# Update the GIT repo to follow the SVN branch
cd ${ROOT}/repo.git
git config --add svn-remote.newbranch.url 
git config --add svn-remote.newbranch.fetch :refs/remotes/newbranch
git svn fetch newbranch
git checkout -b local-newbranch -t newbranch
git svn rebase newbranch
gitk --all

Reply via email to