Monday, August 27, 2012

git-svn cheat list

I moved to a new company, unfortunately here all most all use svn =( It's pity. So I made some cheat list to use git-svn inside this hell. All story based on Gentoo of course =)



At first I need subversion support in git

nika_gt nika # equery u git
...
 + + gtk        : Include the gitview contrib tool.
...
 + + subversion : Include git-svn for dev-vcs/subversion support.
...
 + + tk         : Adds support for Tk GUI toolkit

Clone it

Many repos contains external dependencies, when one type svn co repo, svn automatically clone it too, but git doesn't do it. We need to clone it manually. How can we know which directories are external repos? With this command

$ svn propget svn:externals https://site/trunk
Authentication realm: <https://site:443> SVN
Password for 'XXX':
ui/qtsingleapplication https://site/tps/qtsingleapplication/tags/qtsingleapplication-2.6/src
 
Now we know, that ui/qtsingleapplication is external and we must clone it manually

git svn clone https://site/trunk SomeStuff
git svn clone https://site/tps/qtsingleapplication/tags/qtsingleapplication-2.6/src SomeStuff/ui/qtsingleapplication

Pull

but before pull I need to reset my repo to make it consistent with remote (it's svn baby, create local branches and merge it with svn). So better to have local branch where we can build and patch code and merge it with master.
git reset --hard
git svn rebase

Not about git svn, but about cert

Do not forget about /home/user/.subversion/servers

[site]
ssl-client-cert-file = /some_path/XXX.p12
username = XXX
store-plaintext-passwords = no

No comments:

Post a Comment