Git-svn forking without copying each subdirectory

Our project looks something like this:

trunk/foo trunk/bar trunk/baz 

The subdirectories foo, bar and baz are actually not related to each other, and the bars and bases are actually quite huge. How to create a branch using only foo, so my branches look something like this:

 branches/branch1/foo branches/branch2/foo 

Right now, I am branching the entire chest and then deleting the bar and base, but I think that would be problematic during the merge, as he would try to remove the panel and baz. I would like him to be smart enough to know that I just want to work with foo and not do anything with a bar or base.

The secondary question is not so important that if I want a branch with foo and bar, for example:

 branches/branch1/foo branches/branch1/bar 

Will the process of branching these two folders without branching the rest be more complicated?

Edit: I was told that I can use svn cp. It works, but I was hoping to work with git svn repo, and as far as I can tell, the closest analogue git -svn should svn cp - a branch of ww ww ww ww ww ww wwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwww wswwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwsssss ssnnwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwww wwwwwssssssssnnw w. Unfortunately, I cannot find any option there that allows me to deploy only a specific subdirectory.

+4
source share
4 answers

Usually one giant svn repository is represented by many git repositories. You should have used git svn init .. -t trunk/foo -b branches/branch1/foo -b branches/branch1/foo etc. Note: init , not clone . Then edit .git/config :

 [svn-remote "foo"] url = http://server.org/svn fetch = trunk/foo:refs/remotes/foo/trunk branches = branches/*/foo:refs/remotes/foo/branches/* tags = tags/*/foo:refs/remotes/foo/tags/* 

Then do git svn fetch . Alternatively, you can specify --ignore-paths , for example, to ignore the docs directory.

After that, git svn branch should do the right thing. See the git-svn manual .

+4
source

svn copy will happily work at any level of the folder structure.

Just do:

 svn cp trunk/foo branches/branch1/foo 

Think of it as a typical unix file system.

You may need to add -parents to the cp line if branch1 does not exist yet.

+2
source

Branching in Subversion is basically just copying files (but they are not copies, as they take up no space). So:

 svn cp svn://server/repo/trunk/foo svn://server/repo/branches/branch1/foo 

You do not need to copy the bar and baz directories if you do not want to. In addition, you can copy everything (since the copy is essentially free) and check only what you need:

 svn cp svn://server/repo/trunk svn://server/repo/branches/branch1 svn co svn://server/repo/branches/branch1/foo 
0
source

not sure about the exact syntax for this, and I don't know if this will work, but I think you could try creating three different submodules git folders.

can you direct git clones to each trunk individually and clone them that way?

0
source

Source: https://habr.com/ru/post/1336082/


All Articles