我在Git存储库中有一个Wordpress插件:https://github.com/pushpad/pushpad-wordpress
我想继续使用git进行开发。但是我必须将副本发布到SVN才能在Wordpress.org上发布插件:
https://plugins.svn.wordpress.org/pushpad-web-push-notifications/
我正在寻找最简单的解决方案。 SVN存储库为空。我不能使用git svn clone
,因为我不想创建新的git repo。
我想简单地将git master分支推送到SVN trunk。我怎么能这样做?
我尝试将以下代码添加到.git / config
[svn-remote "svn"]
url = https://plugins.svn.wordpress.org
fetch = pushpad-web-push-notifications/trunk:refs/remotes/trunk
branches = pushpad-web-push-notifications/branches/*:refs/remotes/*
tags = pushpad-web-push-notifications/tags/*:refs/remotes/tags/*
然而,当我运行git svn fetch svn
时,git开始搜索数百万个引用Wordpress.org托管的所有插件的修订版。所以我必须杀死那个命令。另外git branch -a
没有为svn显示任何新分支。所以我不知道如何继续。
答案 0 :(得分:0)
git svn init <linkToRepositoryOrFolder>
git svn dcommit
svn remote的git config中的代码应该类似于:
[svn-remote "svn"]
url = http://mySVN/wordpresspluginrepository
fetch = :refs/remotes/git-svn
执行git svn init后会自动添加远程,url必须完整,而不仅仅是服务器根
答案 1 :(得分:0)
你必须执行:
git svn clone -r540813:HEAD -s --no-minimize-url https://plugins.svn.wordpress.org/wp-agenda/
-r540813
是您的第一个修订版,https://plugins.svn.wordpress.org/wp-agenda/
是Wordpress中插件SVN存储库的示例
要获取第一个修订号,您可以使用:
git svn log https://plugins.svn.wordpress.org/wp-agenda/
第一个修订号将显示在控制台输出的最后一次提交中