-
Notifications
You must be signed in to change notification settings - Fork 350
Git best practices
Kenny Yu edited this page Oct 23, 2013
·
2 revisions
Here are a few tips on how to use git effectively
- Commit OFTEN. Having commits gives you the ability to go back to this point in history in case you ever find yourself in a buggy situation.
- Use descriptive commit messages. You're not going to remember what you coded last week. Having a message like "fixed test 17, but test 18 is failing" is more helpful than "commit message".
- Keep your commits small. Try to make all the changes in one commit be part of one single, simple, logical unit.
- Setup your
.gitignore
file to tell git to ignore certain files in your project that should not be snapshotted (e.g. auto-generated files should not be checked into git. Examples include *.o files generated bygcc
, and the final compiled program). git help