1

I've just started using git-svn to allow for more fine-grained branching and committing than I'd be able to use with the remote, controlled-by-another-company svn repo we're working in.

I've now set up my .gitignore and .gitattributes files for the branch, in my workspace, and I would prefer to be able to submit (and thus track) them in my local git repo. However, when dcommitting my changes -/hardback to svn, those files must not be submitted back into the svn repo.
I can't just ignore the folder they're in either, however, because of course they're in the root of the workspace.

Does anyone have a solution? (apart from ignoring them in the git-svn branch, sym-/hardlinking them in from another location and adding them to a git repo there--it's overcomplicated and they're not in their corresponding branch anymore then, so I'd rather try to find a different solution in that case).

3
  • as a workaround for the .gitignore you could've used .git/info/exclude Commented May 6, 2018 at 14:05
  • @MykolaGurov is it possible to track changes in that file tho? Because if not, it has no real benefit for me... Commented May 7, 2018 at 8:57
  • no, not out of the box Commented May 7, 2018 at 9:00

1 Answer 1

0

As seen here, there is no easy solution.

For common files, you could use git update-index --assume-unchanged <file>, but in your case, you want to exclude a file from being part of the svn repo.

The only workaround (more complex, I know) would be to do your svn dcommit from a dedicated branch where you delete those 2 files.
Then you switch back to your original Git branch and go on working, until the next svn dcommit.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.