How can I use GIT in my own server?

How can I use git for local development and subversion on server?

  • Answer:

    I am working on implementing exactly this for a team now. Fortunately, it looks like it is going to be very easy! There is SVN support built in to recent versions of git. Here's what it would look like:   First we import our target SVN repository in to a local git repository $git svn clone -s https://svn.yourdomain.com/svn/project Make your own git branch: $git checkout -b work trunk Do some work... $touch README Stage the files that were changed $git add . Make a git commit locally $git commit -a -m "I am making a commit" Now if we want to sync the changes back to the remote SVN server: $git svn dcommit   You're all set! There are some caveats to be aware of: "git svn clone -s..." - This tells git to expect standard SVN layout (./trunk. ./branches, ./tags, etc)   From what I have read it is a very bad idea to use a remote branch locally. That is why in the example above we made our own local branch after cloning the SVN repository. I am not sure why this is. If I find out I will update this answer (but if someone else knows feel free to edit!)   The git svn command decompiles the git "blob" and pushes each commit/change seperately with the log message to SVN. Very cool.   Another tip: You can import svn:ignore into a .gitignore with a little command line fu: $(echo;git-svn show-ignore)>>.git/info/exclude   I hope that helps! Let me know how it goes for you. EDIT: Sources: http://blog.tsunanet.net/2007/07/learning-git-svn-in-5min.html http://git.or.cz/course/svn.html http://www.viget.com/extend/effectively-using-git-with-subversion/ http://www.kernel.org/pub/software/scm/git/docs/git-svn.html

Dan Miller at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.