Reputation: 2301
My company uses Subversion; I prefer Git. I have cloned the Subversion repository on my work machine using git-svn and am relatively comfortable using Git as a Subversion client. Now I would like to take the arrangement a step further and leverage the decentralized nature of Git to be able to work on this project from outside the office. Ideally, I would like to mirror all change to my local (office) working copy to my Github account and also the reverse - have all changes to my Github repository made while out of the office be synced/pushed/mirrored to the working copy on my work machine (which is the cloned Subversion repository). Is this possible? How would I begin? Is there another arrangement which will allow me to work away from the office yet still have the working copy at the office be my primary workspace?
Upvotes: 1
Views: 403
Reputation: 97385
Ideally, I would like to mirror all change to my local (office) working copy to my Github account and also the reverse
No problem.
Create new github repo, add this repo as remote to your local Git-repo, push-pull to-from Github (if you'll be able to communicate with Github from office LAN, check it). At home|any other place you start from cloning you Github repo and will use the same pull-push method later
Another solution (in case of very liberal IT-policy and security) can be direct clone-pull-push from your workplace
Upvotes: 0
Reputation: 7496
Yes, git-svn supports all these workflows. I'm not sure about how it works if you started out by cloning, but if you do your first checkout of code using
git init svn+ssh://my-server.com/svn
git will both create a git repository and store necessary SVN information.
You should check out the command
git svn dcommit
It allows you to push to an SVN repository the same way you would push to a git repository on github. To get changes, try
git svn fetch
If you run
git branch -r
you'll see a list of branches, which includes SVN codelines. If you are used to merging code to master before pushing, you want to make sure you merge to the "trunk" branch as one would in SVN, but other than that is the same as using git.
Upvotes: 1