Your SlideShare is downloading. ×
0
Open Source Collaboration
   with Git and GitHub
      by Benjamin Young
     adapted from work by
        Nick Quaranto
whoami
• President of BigBlueHat
  – a web manufacturing company
  – we build web stuff
• We built BlueInk
   – a content ...
Ve rs io n Co ntro l
c o uld s a v e y o ur
        life .
Or a t le a s t y o ur
jo b/pro je c t/ide a /
    s a nity /g pa
The Basics
• Keep “backup” copies of files whenever
  you want
• Restore those copies quickly and easily
• Share the files...
Directed Acyclic Graph
Git Internals: Blobs


                                                    main.c


457aef 93f f 7f f bb289f 7e1384f 90067...
Git Internals: Trees
Git Internals: Commits
Git Internals: Commits
Giting Started
•   mkdir new_proj       •   cd old_proj
•   cd new_proj          •   git init
•   git init             •  ...
The Staging Area
What's changed?
git status
On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be...
What's changed? (cont)
git diff
diff --git a/index.php b/index.php
index 9e7353c..1764d3e 100644
--- a/index.php
+++ b/ind...
Birds Eye View
• git log
• gitk
  – a graphical view of your repository
• GitX
  – Mac OS X app for doing the above
  – al...
Git Internals: Branches



branchna
   me



 HEAD
Branching
Branching
• Another great reason to use Version
  Control—particularly git
• “Your first idea is never your best idea”
• B...
Branching (cont)
• git branch experimental
  – creates a branch named 'experimental'
• git branch
  – shows a list of bran...
The Staging Area (cont)
• All that happened in the same directory
  – sort of...
• Your version histories actually in the ...
Put it back together again
• git checkout master
• git merge experimental

• if all went well, then your done
• if not:

•...
Git Internals: Remotes



branchna
   me
           remotes/server/na
                 me
 HEAD
Local vs. Remote
Multiple Workflows
Centralized
Integration Manager
Benevolent Dictator
Where to Share
=
Other Hosting Options
• Public Only        • Public and Private
  – repo.or.cz         – GitHub.com
  – Gitorious.org     ...
How to Contribute
1.   Fork a repository at GitHub
2.   Clone and connect your local repository
3.   Write tests, implemen...
git log
• Kudos to Sc o tt Cha c o n who made
   – http://git-scm.com
   – http://whygitisbetterthanx.com
• And to Mic ha ...
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
The Basics of Open Source Collaboration With Git and GitHub
Upcoming SlideShare
Loading in...5
×

The Basics of Open Source Collaboration With Git and GitHub

1,901

Published on

A revised/minimized version of Nick Quaranto's (http://www.slideshare.net/qrush ) presentation on the same topic. This revised version was used to present Git to a group of students at ECPI who were not yet familiar with the concepts of version control or Git.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,901
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
19
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "The Basics of Open Source Collaboration With Git and GitHub"

  1. 1. Open Source Collaboration with Git and GitHub by Benjamin Young adapted from work by Nick Quaranto
  2. 2. whoami • President of BigBlueHat – a web manufacturing company – we build web stuff • We built BlueInk – a content management system • Building sites since the late 90's – I remember Netscape 3
  3. 3. Ve rs io n Co ntro l c o uld s a v e y o ur life .
  4. 4. Or a t le a s t y o ur jo b/pro je c t/ide a / s a nity /g pa
  5. 5. The Basics • Keep “backup” copies of files whenever you want • Restore those copies quickly and easily • Share the files and the change s with other developers • Integrate their changes into your files
  6. 6. Directed Acyclic Graph
  7. 7. Git Internals: Blobs main.c 457aef 93f f 7f f bb289f 7e1384f 900679eac f 044a
  8. 8. Git Internals: Trees
  9. 9. Git Internals: Commits
  10. 10. Git Internals: Commits
  11. 11. Giting Started • mkdir new_proj • cd old_proj • cd new_proj • git init • git init • git add . • ...do some work... • git commit • git add . • git commit
  12. 12. The Staging Area
  13. 13. What's changed? git status On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: index.php #
  14. 14. What's changed? (cont) git diff diff --git a/index.php b/index.php index 9e7353c..1764d3e 100644 --- a/index.php +++ b/index.php @@ -24,4 +24,5 @@ require_once 'webroot'.DIRECTORY_SEPARATOR.'index.php'; -?> No newline at end of file +echo 'an example change'; +?>
  15. 15. Birds Eye View • git log • gitk – a graphical view of your repository • GitX – Mac OS X app for doing the above – also handy for commit review – prettier than gitk
  16. 16. Git Internals: Branches branchna me HEAD
  17. 17. Branching
  18. 18. Branching • Another great reason to use Version Control—particularly git • “Your first idea is never your best idea” • Branches give you the freedom to change things...whenever
  19. 19. Branching (cont) • git branch experimental – creates a branch named 'experimental' • git branch – shows a list of branches: • git checkout experimental – switch to the new branch
  20. 20. The Staging Area (cont) • All that happened in the same directory – sort of... • Your version histories actually in the .git folder • so, when you checkout a branch git changes all the files outside of .git to match that branches content • git it?
  21. 21. Put it back together again • git checkout master • git merge experimental • if all went well, then your done • if not: • git mergetool • git commit -a
  22. 22. Git Internals: Remotes branchna me remotes/server/na me HEAD
  23. 23. Local vs. Remote
  24. 24. Multiple Workflows
  25. 25. Centralized
  26. 26. Integration Manager
  27. 27. Benevolent Dictator
  28. 28. Where to Share
  29. 29. =
  30. 30. Other Hosting Options • Public Only • Public and Private – repo.or.cz – GitHub.com – Gitorious.org – CodaSet.com • Private Only – Unfuddle.com – codebasehq.com
  31. 31. How to Contribute 1. Fork a repository at GitHub 2. Clone and connect your local repository 3. Write tests, implement functionality 4. Commit your local changes 5. Push your changes to your fork 6. Make a pull request 7. Profit!!
  32. 32. git log • Kudos to Sc o tt Cha c o n who made – http://git-scm.com – http://whygitisbetterthanx.com • And to Mic ha e l Ha rtl – for Building the Insoshi Social Network • Wikipedia too. nick@quaran.to byoung@bigbluehat.com http://litanyagainstfear.com http://bigbluehat.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×