2019-02-19 | Tips | SVN
I usually use Git for version control, but my debut as a WordPress plugin developer required me to use SVN.
And I was excited to know Git actually can be used as a valid SVN client as well, as stated in the official documentation! This means I can manage my plugin code on SVN repository as well as GitHub at the same time.
Here’s what I did:
- Commited the files using normal SVN client (I used Tortoise SVN) to the SVN repository
- Create new repository on GitHub
- On local machine, create empty directory
git clone -s <SVN repository URL>
git add remote <GitHub repository URL>
git push origin master
and done! The directory is ready for commits to both GitHub and SVN repository.
In the step 4 git svn clone, in my case this had to be an http address. https didn’t work and it took me while to figure out.
git svn clone command takes pretty long. You can specify the revision number like below and then it fetches only versions from the specified revision number:
git svn clone -s -r<revision number>:HEAD <SVN repository URL>