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

Git, GitHub and Open Source

Lorna Mitchell
November 20, 2013

Git, GitHub and Open Source

Lorna Mitchell

November 20, 2013
Tweet

More Decks by Lorna Mitchell

Other Decks in Technology

Transcript

  1. GitHub "We make it easier to collaborate with others and

    share your projects with the universe" • GitHub is hosted source control, based on git • Used for many open source projects, also good for your own projects • Competing alternatives exist
  2. Why Fork? • To have your own copy • To

    allow you to share changes without having write access • It is possible to clone a read-only repository
  3. Git Remotes Your local repo has remotes • origin is

    created by default and points to where you cloned from • upstream is usually the main project repo • Add as many remotes as there are collaboration points To view remotes: git remote -v
  4. Update Your Fork Push changes from your local fork to

    your GitHub origin: git push This defaults to origin but you can also specify which branch to push and to where: git push upstream develop
  5. Git and Branching Branching is quick, easy and efficient. More

    importantly, so is merging! Your repo will switch itself to a different branch when asked
  6. Git Branching Strategies Each project will have its own branching

    strategy. You may need to: • branch per feature • branch per ticket (with appropriately-named branches) • branch per version
  7. Make a Branch New branch called experiment: git checkout -b

    experiment Push the contents of that branch to your GitHub origin: git push origin experiment Change to an existing branch: git checkout otherCoolFeature
  8. Git Status Shows various sets of changes • Changes staged

    for commit • Modified files • Untracked files • (Unmodified tracked files aren't shown)
  9. Git Diff See changes in the working area: git diff

    See changes staged for commit: git diff --staged
  10. Some Notes on Committing • One feature, many atomic commits,

    one branch • Meaningful commit messages • Layout/coding standard fixes should be separate • Git encourages careful preparation of commits
  11. Pull Requests Literally request someone does a pull from your

    repo! They provide: • an easy way to see offered changes • a great interface for reviewing changes • tools for discussion of changes
  12. How to Contribute Projects will publish some information for you

    • Contributor guidelines • Contact mechanisms • Issue lists http://joind.in/about
  13. Thanks Feedback please! Lorna Mitchell, consultant, author, developer and trainer,

    available for interesting projects • http://github.com/lornajane • @lornajane • http://lornajane.net