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?
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:
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.
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.
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.
It is possible to do that. There are tools that make it easier: git-svn
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With