Changes between Version 6 and Version 7 of GitTips


Ignore:
Timestamp:
03/26/2010 06:14:47 PM (14 years ago)
Author:
andar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GitTips

    v6 v7  
    4545git update-index --no-assume-unchanged <ignored-tracked-file> 
    4646}}} 
     47 
     48== Stashing untracked files == 
     49 
     50At times you will be working on a branch with untracked files (new files) and you'll need to checkout master to apply a bug fix. 
     51 
     52First, add the untracked files to the index: 
     53{{{ 
     54#!sh 
     55git add <untracked-files> 
     56}}} 
     57 
     58Now do a regular stash: 
     59{{{ 
     60#!sh 
     61git stash 
     62}}} 
     63 
     64At this point you can checkout whatever branch you want and do what you need to do.  When you're done, checkout your original working branch again and pop the changes from your stash: 
     65 
     66{{{ 
     67#!sh 
     68git stash pop 
     69}}} 
     70 
     71You can remove the files you indexed from the index if you want, as to not pollute your next commit: 
     72{{{ 
     73#!sh 
     74git rm --cached <files> 
     75}}}