Changes between Version 3 and Version 4 of git-svn-tutorial

Show
Ignore:
Timestamp:
08/04/09 17:35:59 (5 years ago)
Author:
packy
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • git-svn-tutorial

    v3 v4  
    4141This will update your local checkout and then re-apply your local un-submitted commits on top of the new trunk. 
    4242 
     43= Neat Tricks = 
     44 
     45One 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 
     46{{{ 
     47    git rebase -i HEAD~10 
     48}}} 
     49And git will launch your $EDITOR and allow you to perform what's referred to as an "interactive rebase." 
     50{{{ 
     51    pick 08464ae bug 9074 Fix bad logging call. 
     52    pick 8750643 bug 9995 Run the supplied architecture through arch_extract() to change 'x64' into 'x86_64' when it occurs. 
     53    pick af6f7ae bug 9995 Make sure the architecture string occurs on word boundries (ie, it's not part of a larger word) 
     54    pick 8e4ef0c Don't generate a warning for generic apps. 
     55    pick 1e4d124 Add a module for handling script-based custom applications. 
     56    pick 808607d bug 9879 Resolve paths to entity IDs at the start of a process. 
     57    pick e02a0db bug 9879 Cosmetic code formatting changes. 
     58    pick 3e1cc94 bug 10010 Added an optional comparator argument to compare_homes 
     59    pick 218805c bug 10010 Added comparator argument to default implementation for consistency 
     60    pick 21e20fa bug 10010 Made procs_under_home use compare_homes to handle case insensitivity on windows 
     61 
     62    # Rebase 05e760e..21e20fa onto 05e760e 
     63    # 
     64    # Commands: 
     65    #  pick = use commit 
     66    #  edit = use commit, but stop for amending 
     67    #  squash = use commit, but meld into previous commit 
     68    # 
     69    # If you remove a line here THAT COMMIT WILL BE LOST. 
     70    # However, if you remove everything, the rebase will be aborted. 
     71    # 
     72}}} 
     73If you change any of the lines that start with "pick" to start with "squash" instead, when you exit your {{{$EDITOR}}}, that commit will be squashed into the commit above it and you'll be popped back into {{{$EDITOR}}} to combine the commit messages into one.  You can also squash multiple commits into more than one commit in a single session; {{{$EDITOR}}} will be fired up for each of the resulting commits for you to combine the commit messages. 
     74 
     75You can also __reorder__ commits just by moving them up or down in the list, and you can drop commits entirely by removing them from the list. 
     76 
     77Attached to this page is a perl script called [https://trac.parrot.org/parrot/attachment/wiki/git-svn-tutorial/gsquash 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. 
    4378= Questions = 
    4479