Changes between Version 5 and Version 6 of GitMigrationProposal

Show
Ignore:
Timestamp:
03/15/09 06:00:16 (4 years ago)
Author:
cdavid
Comment:

Add revert scenario

Legend:

Unmodified
Added
Removed
Modified
  • GitMigrationProposal

    v5 v6  
    9797}}} 
    9898 
     99You can add some aliases so that some git commands spell like the svn ones. The following are useful: 
     100 
     101{{{ 
     102git config alias.co checkout 
     103git config alias.ci commit 
     104git config alias.st status 
     105}}} 
     106 
     107== Scenario 1 == 
     108 
     109Getting the sources from the NumPy repository, just to look at the sources, or to build from last version instead of released: 
     110 
     111{{{ 
     112git clone http://git.scipy.org/git/numpy numpy 
     113}}} 
     114 
     115A tarball will also be made available on the scipy website, so that you don't need git at all in this scenario. 
     116 
     117== Scenario 2 == 
     118 
     119I have found a bug, and I want to submit a patch. I want to do it like in svn, I don't care about git: 
     120 
     121{{{ 
     122# This will list the changed files 
     123git status 
     124# This will put the changes into a patch 
     125git diff 
     126}}} 
     127 
     128== Scenario 3: reverting changes == 
     129 
     130I have made some changes, but I am confused, I just want to restart from last revision and throw everything away. 
     131 
     132There are several solutions - do NOT use revert, git revert is totally different from svn revert. The safe and easy one: 
     133 
     134{{{ 
     135git stash 
     136}}} 
     137 
     138This will put your changes aside (in a 'stash'), and your working tree will be exactly as if you checked out from the last revision of your repository. It is safe because your changes are not lost - you can reapply them: 
     139 
     140{{{ 
     141git stash apply 
     142}}} 
     143 
     144If you really don't care about the changes, and are ready to throw them away with no change of recovering: use the checkout option: 
     145 
     146{{{ 
     147git co myfile 
     148}}} 
     149 
     150This will have the same semantics as svn revert.