在特定的提交中从git / svn repo推送到git / branch

时间:2022-02-14 15:30:22

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

有一段时间,SVN repo被克隆到commit c75e75c。一个团队在git / master上工作,另一个团队在SVN工作。

  • We are using git-svn on the svn repo.
  • 我们在svn repo上使用git-svn。
  • 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
  • 我可以将svn / trunk合并到git / master中,但这非常糟糕。所以我更喜欢将c75e75c之后的所有提交推送到branch / app_v2
  • The git/branch is simply a copy of svn/trunk after commit c75e75c.
  • 在提交c75e75c之后,git / branch只是svn / trunk的副本。

在特定的提交中从git / svn repo推送到git / branch

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.

尝试使用git push 如何将特定提交推送到远程,而不是之前的提交? 。我创建了一个远程分支/ app_v2。但是git-svn和git repo上的提交SHA并不相同。即使他们有共同的历史。

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

如何推送一系列提交(在c75e75c和HEAD之间)并推送到远程分支(branch / app_v2)?

1 个解决方案

#1


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 repo上,创建远程分支(注意它与SVN的c75e75c版本相同,但它在其他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

在SVN repo上,回滚到修订版推送

git checkout c75e75c

push to the remote branch

推送到远程分支

git push origin <current_locale_branch>:<branch_name> 

Any questions ?

任何问题 ?

#1


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 repo上,创建远程分支(注意它与SVN的c75e75c版本相同,但它在其他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

在SVN repo上,回滚到修订版推送

git checkout c75e75c

push to the remote branch

推送到远程分支

git push origin <current_locale_branch>:<branch_name> 

Any questions ?

任何问题 ?