简体   繁体   中英

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. I had a subversion checkout and in a subfolder a 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. The KIF folder was linked to my branch of KIF on GitHub.

I have since started using git-svn so I can work locally using git. But, when I checked out projectA using git-svn, the KIF portion is only pulling and pushing from the subversion side. The GitHub side of the KIF folder has been lost.

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.

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.

First of all make sure you have checked in the .git folder under KIF into SVN.

git ignore .git directory and you cannot force it to add it whatever you do. So when you do a git-svn clone, the .git under KIF will not turn up. You will have to manually svn checkout that and put it under KIF and then operate KIF as a git repo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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