简体   繁体   English

您如何在文件夹中使用git-svn并在子文件夹中使用git并同时推送到两者?

[英]How do you use git-svn with a folder and git in a subfolder and still push to both?

I'm familiar with Subversion but still getting used to Git. 我对Subversion熟悉,但仍然习惯了Git。 I had a subversion checkout and in a subfolder a git clone. 我进行了Subversion检出,并在子文件夹中进行了git clone。

Previously: 先前:

projectA/     = SVN->SvnRepo
    Source/   = SVN->SvnRepo
    Tests/    = SVN->SvnRepo
        KIF/  = SVN->SvnRepo and GIT->GitHub

Changes to the KIF folder were committed to svn and to the git repos separately with the separate tools. 对KIF文件夹的更改已通过单独的工具分别提交给svn和git repos。 The KIF folder was linked to my branch of KIF on GitHub. KIF文件夹已链接到我在GitHub上的KIF分支。

I have since started using git-svn so I can work locally using git. 从那以后我就开始使用git-svn,因此我可以在本地使用git进行工作。 But, when I checked out projectA using git-svn, the KIF portion is only pulling and pushing from the subversion side. 但是,当我使用git-svn检出projectA时,KIF部分只是从颠覆端拉动。 The GitHub side of the KIF folder has been lost. KIF文件夹的GitHub端已丢失。

Now: 现在:

projectA/     = GIT-SVN->SvnRepo
    Source/   = GIT-SVN->SvnRepo
    Tests/    = GIT-SVN->SvnRepo
        KIF/  = GIT-SVN->SvnRepo

I would like to set it up so changes in the KIF folder can be pushed to both the local subversion repository and the GitHub project. 我想进行设置,以便可以将KIF文件夹中的更改同时推送到本地Subversion存储库和GitHub项目。

What I want: 我想要的是:

projectA/     = GIT-SVN->SvnRepo
    Source/   = GIT-SVN->SvnRepo
    Tests/    = GIT-SVN->SvnRepo
        KIF/  = GIT-SVN->SvnRepo and GIT->GitHub

So, how do I set this up and use it? 那么,如何设置和使用它呢?

I am currently using git svn rebase to update from the subversion repository and git commit -m "..." then git svn dcommit to push changes into subversion. 我目前正在使用git svn rebase从subversion存储库中进行更新,并且git commit -m "..."然后git svn dcommit将更改推送到Subversion中。

First of all make sure you have checked in the .git folder under KIF into SVN. 首先,请确保已将KIF下的.git文件夹签入SVN。

git ignore .git directory and you cannot force it to add it whatever you do. git忽略.git目录,您不能强制它添加它,无论您做什么。 So when you do a git-svn clone, the .git under KIF will not turn up. 因此,当您执行git-svn克隆时,KIF下的.git不会出现。 You will have to manually svn checkout that and put it under KIF and then operate KIF as a git repo. 您将必须手动svn checkout并将其放在KIF下,然后将其作为git repo进行操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM