Archive:Development/Tutorials/Git/Intermediate

From KDE TechBase
Revision as of 14:07, 1 March 2011 by Odysseus (talk | contribs)
Warning
This page is yet to be reviewed for changes required by the migration to Git. Information and commands on this page may no longer be valid and should be used with care. Please see the KDE Git hub page for more details.


Once you're comfortable committing code with git, there are some simple things that can save you time and effort...

TODO

  • feature branches for fun and profit
  • shared branches?

Handling local changes: git stash

Sometimes (eg. when using git svn rebase) Git won't let you proceed if you have uncommitted changes. If you don't want to commit those changes, you can use git stash instead. This command stores the local changes safely out of the way on a stack. When you want those changes back it can re-apply them to your repository and clear the stack. A very handy feature in many situations! Just do this:

git stash git svn rebase # or whatever it was you were trying to do git stash pop # apply-and-clear

There are more features of git stash explained in the fine manual. :) git help stash