Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two repositories (1 svn and 1 git) on same folder?

Tags:

git

svn

We are working on a project for a client that has a git repository and we need to commit changes at the end of the week. In the same time, we also keep a local svn repository where we commit daily to keep track of changes. Would there be a problem to keep the .svn and .git in the same project folder? I'm thinking if I put the .svn in the gitingore and also tell svn to ignore the .git, I should be able to use the same project to commit daily on our local svn and also weekly on the git.

Has anyone tried this or does anyone see a problem with this approach?

like image 520
Biggie Mac Avatar asked Jul 03 '13 06:07

Biggie Mac


People also ask

How to maintain the SVN and Git repository?

The constant we must maintain between the SVN and Git repository is: The Git repository’s master branch should always be equivalent to the SVN trunk, commit for commit. To start, let’s assume we have an existing SVN repository called project. If we were to checkout this repository and look at it’s commit history, it might look something like this:

How to create a second Git repository from a project?

1. First clone your project from one of these repositories like this: 2. Clone the repository from Github: 3. Open the folder with the cloned project: 4. Now we will manually edit Git repository ‘s configuration file where we will add the second repository as a new remote source. Open .git/config file.

Should I use Subversion or Git?

There’s nothing wrong with Subversion, but sometimes you want the power of Git. I personally prefer Git’s ability to commit locally and its branching model over SVN. Git can bidirectionally interact with Subversion repositories with the git svn command. To demonstrate how, I will give repeatable, step-by-step instructions.

How do I sync a git branch with an SVN branch?

Create a branch to sync with an SVN branch. Use the naming convention svnsync- {svn_branch_name} where svn_branch_name is the branch name in SVN. For the initial sync it should be the latest release branch. You can have multiple git branches that map to the corresponding SVN branch. Below is just one example.


2 Answers

It is possible to do that. There are tools that make it easier: git-svn

like image 116
Tala Avatar answered Oct 02 '22 08:10

Tala


Please, for the sake of humanity just use git for this :).

Why don’t you just commit to git? You can set up you own central git repo and do your daily week work with that. At the end of the week you just do git push client mybranch. Or if you don’t like your client seeing your internal history, do:

git checkout clientbranch
git merge --squash our-internal-branch
git commit -m "all of this weeks work"
git push client clientbranch
like image 45
Chronial Avatar answered Oct 02 '22 08:10

Chronial