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

Git your act together

Roy Tomeij
November 15, 2011

Git your act together

If you don't use version control, git is a good start. If you use SVN, git has clear advantages. If you use git, I'll dive into some lesser know uses.

The content of this talk is largely dependent on the audience at hand. In the wild I'll either skip some slides or go over them in greater detail. This deck is accompanied by Terminal action :-)

Roy Tomeij

November 15, 2011
Tweet

More Decks by Roy Tomeij

Other Decks in Programming

Transcript

  1. SO, WHAT DO I KNOW? ‣ Hi, I’m Roy Tomeij

    ‣ Co-founder 80beans ‣ Front-end since 1998 ‣ Version control since 2004 ‣ Git since 2008
  2. Why version control? ‣ Have a backup. ‣ Revert code.

    ‣ Have multiple branches. ‣ Know your history. ‣ Work with a team.
  3. How is Git different from SVN? ‣ Distributed instead of

    centralized. ‣ Snapshots instead of differences. ‣ Hash instead of revision number. ‣ Ignoring files is intuitive. ‣ No friggin’ .svn directories.
  4. Branches. ‣ Great way to work on multiple features, versions,

    etc. ‣ Git knows which commits belong to which branch. ‣ Default branch is “master”.
  5. Keep your log clean. ‣ Write proper commit messages. ‣

    Commit everything separately. ‣ Use “git pull --rebase”. ‣ Use “git commit --amend” to fix your list commit (message).
  6. GitHub. ‣ Free public repositories. ‣ Contribute to open source

    projects. ‣ Fork and build upon existing code.
  7. GitHub Pull Requests. ‣ Create a branch for each feature.

    ‣ When done, create a pull request. ‣ Have others peer review. ‣ Merge into your master branch.
  8. Time left? ‣ git blame ‣ git add -p ‣

    git rebase -i ‣ git cherry-pick ‣ git bisect