user643605
user643605

Reputation: 213

Adding another directory for branches in git-svn

According to this question, you can edit your .gitconfig and tell git-svn where to go about to push your latest code change.

In my case, I have a special case where nor the Tags and nor the Branches can be used. So, if you look at the SVN repo, you see something like this:

trunk
branches
tags
xtra

I am new to git-svn and up to know I was fine with working directly with the trunk. Things changed and I need to work with xtra folder and create subfolders in there e.g. xtra/Job1234/ and push into it. How can I do such change ?

If I type git svn info, I get:

URL: https://some.net/repositories/myproject/base/trunk

Clearly, any git svn dcommit pushes things to the trunk. Any leads ?

Upvotes: 4

Views: 1337

Answers (2)

VonC
VonC

Reputation: 1323953

Note that git svn branch can segfault before Git 2.17 (Q2 2018) will provide a workaround for segfault with more recent versions of SVN.

See commit 7f6f75e (29 Jan 2018) by Eric Wong (ele828).
(Merged by Junio C Hamano -- gitster -- in commit 9cd5320, 13 Feb 2018)

git-svn: control destruction order to avoid segfault

It seems necessary to control destruction ordering to avoid a segfault with SVN 1.9.5 when using "git svn branch".
I've also reported the problem against libsvn-perl to Debian Bug #888791, but releasing the SVN::Client instance can be beneficial anyways to save memory.

Upvotes: 0

ulidtko
ulidtko

Reputation: 15560

Try this:

$ git config --add svn-remote.svn.branches "xtra/*:refs/remotes/xtra/*"       ①
$ git svn branch -d xtra Job1234                                              ②
$ git checkout --track remotes/xtra/Job1234                                   ③

... and you should be ready to commit!


Yes, you can also do the equivalent of ① by directly editing .git/config.

Upvotes: 1

Related Questions