I am doing a development project.
The company is using SVN
, so for main commit
and checkout
should be done via SVN
.
However, I don't like SVN
and am a git
user. Since only when I think my code is good I will commit to the company SVN
, I would like to use git
for my own history keeper.
I don't need to use git to do SVN
thing, nor vice versa.
Can I version control my same code using SVN and git at the same time? No interaction between them.
SVN has a Centralized Model. In git every user has their own copy of code on their local like their own branch. In SVN there is central repository has working copy that also make changes and committed in central repository. In git we do not required any Network to perform git operation.
Git has the advantage that it's MUCH better suited if some developers are not always connected to the master repository. Also, it's much faster than SVN. And from what I hear, branching and merging support is a lot better (which is to be expected, as these are the core reasons it was written).
The difference between Git and SVN version control systems is that Git is a distributed version control system, whereas SVN is a centralized version control system. Git uses multiple repositories including a centralized repository and server, as well as some local repositories.
You can clone a subversion repository to your machine using git svn clone <SVN repo URL>
. The code will be available as a git repository. You can do your work there and make local commits as you please. There is a command line option to get a "shallow" checkout rather than the entire repository which is often useful. I forget what it is.
Anytime, you want to run the equivalent of svn update
, do a git svn rebase
. This will fetch new commits which were checked into SVN after you last synchronised and then rebase your changes onto the new tip.
When you're ready with your commits, do a git svn dcommit
. This will send all your new commits to svn one by one. You can also squash your local commits into a single one and send it by first doing a local rebase and then an svn dcommit. This should be done on the initial branch (usually master
).
The very fact that you're checking out from subversion and then working locally in git means that there is "interaction" between them so your last statement is not valid.
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