Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git commits

Avatar for Emil Kampp Emil Kampp
February 17, 2012

Git commits

What is a git commit? how do I use it, and when should I use it? These are some of the topics that this short slide touches on.

Avatar for Emil Kampp

Emil Kampp

February 17, 2012
Tweet

Other Decks in Programming

Transcript

  1. What is a git commit? A git commit is an

    atomic contribution to the collective codebase. This implies that it should contain a complete feature or bug-fix. The commit should not break any part of the codebase (i.e. should pass all tests) 2
  2. How do I commit? To create a commit you identify

    the minimum code changes that’s required for the feature or bug-fix to complete. You then stage the changes and commit them. If you want further features you repeat the process. 3
  3. When to commit? Before you make any commits to the

    codebase, you must make sure that you have the latest version. You should make a pull request and test the code before every commit. 4
  4. What to write? A commit message, is a single line

    describing the intention of the commit. E.g.: This fixes #33, the facebook login button bug. It should always be in present time. And you should always keep your messages below 50 characters. 5
  5. Github stuff Creating your commit in the right will also

    help you keep a tidy Github. They have simple hooks to close issues such as: fixes and closes. So a commit message like: This closes #87 will close issue number 87 in the issue tracker. 6