Linking SVN repository trunk as branch for Git repository subfolder

I have open source project in Git repository. In the project, I’m using source code of another open source project. That code is stored in Git repository subfolder. I’d like to add the SVN repository [interested in trunk only] as a branch, but only for that specific Git subfolder.

Note that I have modified the code of the other project, so I’m not looking for simple 1:1 copy. I just want to have an option to merge changes from the SVN to my Git repository, when I decide to do so. I will NOT need to commit back to SVN.

  • How does Git handle branches compared to SVN?
  • Is cross-branch reference possible?
  • In git, is there a simple way of introducing an unrelated branch to a repository?
  • Git new file appears in all branches
  • Cloning only a specific branch on Github?
  • Dealing With Multiple Git Heads locally and on the server
  • I’ve found How to use gitsvn to checkout only trunk and not branches and tags?

    But I do not know how to link it to a subfolder only.

  • How to list local commits difference in git
  • How to reuse a branch in git?
  • How to provide password ( that has @ ) when run “git clone https://remote.git” in python script?
  • How to smoothly rename a Phoenix Project?
  • How to get only remote git operations to trigger a ssh-add event for ssh-agent?
  • Fastest way to figure out if a git repo has unpulled changes for scripting?
  • 2 Solutions collect form web for “Linking SVN repository trunk as branch for Git repository subfolder”

    • Convert subfolder or wrapper git-repo into submodule or subtree
    • Link nested repo (I may be wrong in case of subtree technique) with SVN-repo using git-SVN

    It looks like that you want to implement a vendor branch. For example, see this thread How do I import a third party lib into git?.

    Git Baby is a git and github fan, let's start git clone.