Git-svn-helpers v.0.4


git-svn-helpers is a collection of command line tools that greatly simplifies using git for svn repositories.git-svn-helpers's main goal is to make setting up a local git repository following an existing svn checkout a 'no-brainer'.It also addresses using a single git-svn repository for working on multiple checkouts of (usually) different branches and switching between them.Basic usage (Example)Executive summary:> cd path/to/svn/repo> gitifyHere's a sample session:> cd /tmp> svn co 1.1/ out revision 27228.> cd> gitifyNo git repository found in /Users/tomster/.gitcache/.Initiating cloning into cache.Analyzing svn log...Cloning from r10593:27155 into /Users/tomster/.gitcache/Initialized empty Git repository in /Users/tomster/.gitcache/ branch 'local/1.1' is now following svn branch '1.1':# On branch local/1.1nothing to commit (working directory clean)> git branch* local/1.1 masterPoints to note: * gitify limited the cloning to the revisions found in the svn log of the package root (here A big time saver, especially on large repositories (such as plone.collective) * gitify created the git repository at ~/.gitcache not in place * gitify created a local branch local/1.1 that follows the (remote) svn branch 1.1 and switched to itMultiple check-outsIn practice you will often work with different local copies of a given repository, i.e. on trunk and on a feature branch. That's when the .gitcache directory created above comes in handy. Let's move our previous checkout out of the way and create a maintenance checkout that follows trunk:> cd ..> mkdir feature-branch> mv feature-branch/> mkdir maintenance> cd maintenance/> svn co U out revision 27228.What happens if we run gitify here?:> cd> gitifyGit branch 'local/trunk' is now following svn branch 'trunk':# On branch local/trunknothing to commit (working directory clean)Notice, that this operation went much faster, as we now have used the existing git repository in the cache directory. This can be further evidenced by looking at the available local branches now:> git branch local/1.1* local/trunk masterCaveats'Recycling' .git in this manner works (perhaps surprisingly) well in practice, but you need to keep the following in mind:All checkouts share the same index!Let's take a look at what this means by switching back to our feature branch:> cd ../../feature-branch/> git status# On branch local/trunk# Changed but not updated:# (use "git add/rm ..." to update what will be committed)# (use "git checkout -- ..." to discard changes in working directory)## modified: docs/HISTORY.txt...# deleted: plone/app/form/kss/tests/ Untracked files:# (use "git add ..." to include in what will be committed)## plone/app/form/tests/test_kss.pyWohah! What happened is that .git now points to trunk and thus the status command shows the difference between that and our branch as local modifications, since that is what the filesystem represents. We can verify this by using subversions status command:> svn stPhew! All in order! But what to do with git? We've finished working on trunk and want to get back to our feature branch, but the git index is all wrong?! Simple: just re-run gitify:> gitifyGit branch 'local/1.1' is now following svn branch '1.1':# On branch local/1.1nothing to commit (working directory clean)Basically, that's all you need to remember when working with multiple check-outs of the same package: Always run gitify when switching between check-outs!md5=c05e864bb2ab6b7f3e63cccc9254787a

git-svn-helpers is a collection of command ... Command-line tools to make git-svn simple ...

  • Git-svn-helpers
  • 0.4
  • Tom Lazar
  • Linux
  • Freeware
  • 51 Kb
  • 143
  • Free

Review Git-svn-helpers

  • captcha

Other software of Tom Lazar
    New Miscellaneous software
    • Bersoft HTML Print  v.9.09This programmer utility for printing HTML pages and images in an invisible way can be called from your application, passing either the file to print or a file list as a parameter.
    • Metamill  v.8.2.2022Metamill is a professional UML modeling tool. Supports UML 2.4 standard. All 14 UML diagrams supported. Round-trip engineering for Python, ADA, Java, C, C++, C# and VB.Net. RTF and HTML document generation. Fast and easy to use. ...
    • RunETAC  v.2-0.1-6-enaThe ETAC programming language is a general purpose dictionary and stack based interpreted script programming language fully capable of traditional high-level block structured language style syntax.