I have now a Problem between git and svn.
For project intern we use git as repository.
But our customer uses svn as repository.
We have periodically released for our customer. We must commit 4 Modules (actually 4 Ordner) in Customer svn.
The 4 ordner have the same structure in git and svn.
My question: Can I clone these ordner from our git and then commit them to svn basically? If yes, how can I do this?
I heard that there is Git-SVN in git command. Can I use this tool?
that there is
git svn
in git command. Can i use this tool?
You could have, if your git repo was created from the svn one.
But since it is an independent repo, the easiest way is to copy (simply filesystem copy) your ordners to the right place in the svn repo, and svn commit
there: that won't import the git history, but from the client's perspective, that might be enough.
Sometimes our Customer changes our code for bugfixing. Then i must copy the changed code back in my git folder and push it into our git. I think, this copy event between my local git folder and svn folder is troublesome and than can be error-source.
That means before copying your ordners to the client's svn repo, you need to do:
cd /path/to/git/repo/myordner
git checkout -b import
git --work-tree=/path/to/updated/svn/repo/ordner add .
Since the ordners have the same structure in git and svn, ask git to add the ordner from the svn repo (which is viewed by git as a simple working tree) in a branch import, and then merge that import branch into you main one.
No copy required here. git manages the import.
Once that import is done, you can export back to the svn repo as described previously above.