0

At one time, the SVN repo was cloned at commit c75e75c. One team worked on git/master, another team worked on SVN.

  • We are using git-svn on the svn repo.
  • I could merge svn/trunk into git/master but this would terribly awful. So I prefer to push all the commits after c75e75c into the branch/app_v2
  • The git/branch is simply a copy of svn/trunk after commit c75e75c.

enter image description here

Tried with git push <remotename> <commit SHA>:<remotebranchname> How can I pushing specific commit to a remote, and not the previous commits? . I created a remote branch/app_v2. But the commits SHA on git-svn and git repo are not the same. Even they have a common history.

How to push a a range of commits ( between c75e75c and HEAD) and push to remote branch ( branch/app_v2 ) ?

Community
  • 1
  • 1
Raymond Chenon
  • 11,482
  • 15
  • 77
  • 110
  • I don't fully understand your question. Subversion does not use hashes. Creating a new branch on the remote should work the way you did (it must have the same commit hashes as your original branch) – knittl Feb 25 '14 at 15:18
  • I said I use git-svn, so the svn repo's commits are hashes. The git-svn repo is actually the sub folder /trunk of a bigger svn repo. Maybe that's why the commit SHA are not the same. – Raymond Chenon Feb 25 '14 at 15:27
  • cd && git branch branch/app_v2 -f && git push branch/app_v2 -f – basin Feb 25 '14 at 17:01

1 Answers1

0

OK here is the cookbook :

on the Git repo , create the remote branch ( note it is the same revision as SVN's c75e75c but it doesn't have the same has name on the other git repo )

git checkout -b <branch_name> <revision_hash>

then push the branch to remote repo

git push origin <branch_name>

on SVN repo , roll back to the revision to push

git checkout c75e75c

push to the remote branch

git push origin <current_locale_branch>:<branch_name> 

Any questions ?

Raymond Chenon
  • 11,482
  • 15
  • 77
  • 110