Changes between Version 5 and Version 6 of git-svn-tutorial

08/04/09 19:44:09 (12 years ago)



  • git-svn-tutorial

    v5 v6  
    4343= Neat Tricks = 
     45== Interactive Rebase == 
    4546One of the neat things about git is that you can modify your commits before you push them up to the SVN server.  Let's say you've made 10 commits to your local git repository, but you want it to look like two when it gets pushed up to SVN.  All you need to do is type 
    7778Attached to this page is a perl script called [ gsquash] which uses {{{git log}}} to look for commits that haven't been pushed to SVN yet and builds the appropriate {{{git rebase -i HEAD~n}}} command. 
     80== git stash == 
     82Let's say you're working on some stuff that's not quite ready to be checked in, but you suddenly need to work on something else.  You can type {{{git stash}}}, which will record the current state of your work and give you a clean working directory again.  You can then make whatever changes you want to your working directory, commit them, dcommit them to SVN, and then type {{{git stash pop}}} to get what you were working on before back.  You can also build a stack of stashed work by repeatedly making changes followed by {{{git stash}}} commands; you can then list these stashed modifications with {{{git stash list}}}.  For full documentation on the fun of git stashing, type {{{git stash --help }}}. 
     84== Local Branching == 
     85Another benefit of git is it's extremely easy to create a branch in your local git repository: 
     87    git checkout master 
     88    git branch rt1739 
     89    git checkout rt1739 
     91This makes a local branch off your master branch called "rt1739".  You can commit changes to this branch that won't affect your master branch, and you can switch back and forth between your local branches and your master branch.  In addition, each of these branches is connected to the trunk of the SVN repository, so any changes dcommitted from these branches will automagically be merged into the SVN trunk and appear in your local trunk the next time you run {{{git svn rebase}}} when you have your trunk checked out. 
     93Other developers may access your local branches, but in order to do so, they would need to be able to access your git repository. 
    7895= Questions =