Version 1 (modified by 9 years ago) ( diff ) | ,
---|
Git Cautions and Suggestions
Things to avoid
Commands and options that overwrite data
git reset --hard
- The
-f
or--force
option for any command.
Examples:
git checkout -f HEAD git submodule update --force
Once experience and expertise develops, these commands and options can be used (very) sparingly, but they are sharp, dangerous tools.
Things to embrace
Branching and merging
Git users find that branching and merging is so fast, easy, and reliable that branching early and often is a very effective development and maintenance practice. If you aren't branching early and often, you are missing out on one of the major joys of git.
Stashing
Even when working on purpose-created branches, the situation arises where you want to temporarily set aside some work-in-progress. That's what git stash
is for, so learn how to use it.
Acknowledgements
Edward Diener, Michael Cox contributed suggestions and comments in Boost mailing list discussions.