Gittin' it done together!
Tim Burrow & Rouben Tchakhmakhtchian - TKF2016
Follow-along at http://slides.com/rouben/tkf2016-git/live
Wednesday, May 4, 2015 at 2:10pm
Git + Hub =
A social network for coders
Prerequisites
- Be comfortable using git:
- Committing
- Reviewing commit logs
- Creating branches
- Switching and navigating branches
- Merging branches
- Crash course at https://slides.com/rouben/tkf2015-git
Learning git can be tough...
10 CLS
10 PRINT "Hello world!"
20 PRINT "This is my very first program"
30 PRINT "I am very excited about this"
40 PRINT "This is really cool!"
50 PRINT "Bye, I gotta go now!"
60 END
Image used with implicit permission as per http://www.foxtrot.com/educational-re-use/
Git workflows...
...they're more like guidelines!
Centralized Model
Centralized Model
- Similar to SVN...
- ...but better! Why?
- Each developer gets a local copy of the entire repo
- Local branching and merging that works!
- Each developer has their own master branch (trunk)
Shameless git promo
Feature Branch Model
Image credit: git-tower.com, used with permission.
...without setting your hair on fire!
- Single, central repository (like SVN)
- Each feature (developer) gets its/their own branch
- Allows for multiple developers to collaborate on a feature without breaking the master branch (stable code)
- When ready, feature branches are compared to the master (pull request), and merged if accepted
Feature Branch/Forking Model
- master (trunk) - holds the final, pristine "solution"
- Each developer gets their own copy of the entire repo, including the master (trunk) branch. This is called forking.
- They create branches for each feature or task they're working on
- They can test their changes locally, on their own development/test system
- When done, they submit a pull request to the upstream repository
- The community reviews their submission (pull request) and either accepts it or rejects it into the master
a.k.a. Github Flow
Git Flow
What can Github do for me?
It's more than just a server to host your repository!
- De-facto standard for git hosting
- Compatible with any git workflow
- Integrated bug tracker
- Visual code browsing and review tool
- Release hosting
- Project website/blog hosting
- A huge community of helpful developers
- Impressive selection of third-party plugins for...
- Continuous integration (CI)
- Automated release packaging
- Collaboration and communication
GitHub for teams
License to share
- no license ≠ open
-
From http://choosealicense.com/no-license/:
- “…the absence of a license means that default copyright laws apply. This means that you retain all rights to your source code and that nobody else may reproduce, distribute, or create derivative works from your work”
- “…if you publish your source code in a public repository on GitHub, you have accepted the Terms of Service by which you allow others to view and fork your repository.”
http://choosealicense.com
Adding a license when creating your repository
Setting up an organization
- Central place for an “organization”: your team
-
Group owned repositories
- Share responsibilities
- Rich set of permissions
- Control branches & pull requests
- You don’t need an organization if it is just you…
Welcome!
-
Make your organization welcoming for all contributors
-
CONTRIBUTING.md
- Some guidelines: code formats, branching expected
-
How to Join.md
- Contacts, Slack, Trello etc.
- No 1000 line code dumps please!
-
Code of Conduct.md
- http://todogroup.org/opencodeofconduct/
- Gender bias in pull requests https://doi.org/10.7287/peerj.preprints.1733v1
-
CONTRIBUTING.md
Contributor License Agreements
-
Code license agreements
- All contributors license code to your organization (a legal entity)
- Not a copyright transfer
-
CLA assistant (GitHub Service)
- Manage Contributor License Agreements within GitHub Flow
- CLAHub
- Watch out for “cut and paste” code or angry developers (e.g. left-pad)
- Usual if 3rd party organizations are involved
- The Apache license has a license transfer section
Protect the master
Demo
Waffles!
That's all for now!
Thanks for attending!
Illustration credits: git-tower.com and clker.com
used with permission
Resources
- Download git from http://www.git-scm.com/
- Awesome git course/eBook: https://www.git-tower.com/learn/
- Git for Teams eBook/Book: http://gitforteams.com/
- Link to this slideshow: http://slides.com/rouben/tkf2016-git/
- Link to last year's: http://slides.com/rouben/tkf2015-git/
That's all for now!
Thanks for attending!
Illustration credits: git-tower.com and clker.com
used with permission
Resources
- Download git from http://www.git-scm.com/
- Awesome git course/eBook: https://www.git-tower.com/learn/
- Git for Teams eBook/Book: http://gitforteams.com/
- Link to this slideshow: http://slides.com/rouben/tkf2016-git/
- Link to last year's: http://slides.com/rouben/tkf2015-git/
Gittin' it done together!
By Rouben Tchakhmakhtchian
Gittin' it done together!
This is the slide deck to accompany the presentation given on May 4, 2016 at 2:10pm at the annual University of Toronto TechKnowFile (TKF) conference by Tim Burrow and Rouben Tchakhmakhtchian.
- 630