1. Y E S , Y O U C A N G I T !
I N T R O D U C T I O N T O G I T A N D G I T H U B
Carol Willing
@willingcarol
GitHub: willingc
W R I T E S P E A K C O D E
J U N E 1 7 , 2 0 1 6
2. – M A RY O L I V E R
“It’s not a competition, it’s a doorway.”
3. C H AT T I N G
W I T H F R I E N D S
• git
• a tool
• puts you in charge of
source files
• GitHub
• a service
• sharing and collaboration
12. Fork
an open source project
O R I G I N
( y o u o n G i t H u b )
U P S T R E A M
( o p e n s o u rc e p ro j e c t o n G i t H u b )
Click
13. Clone
your fork of an open source project
to your local computer
git clone <url>
git status
git remote -v
14. Add a remote
Let’s create a nickname of the open source project.
upstream sounds like a good nickname.
git remote -v
git remote add upstream <url>
git remote -v
15. Fork
an open source project
Clone
your fork
of an open source project
~/myprojects/wsc-music
https://github.com/<you>/wsc-music
https://github.com/gentlecodegarden/wsc-music
R E V I E W
17. C R E AT I N G
L E T ’ S M A K E S O M E T H I N G F O R T H E P R O J E C T
18. fetch, rebase, push
my workflow for keeping things updated
git fetch upstream
git rebase upstream/master
git push origin master
19. branch, checkout
A feature branch keeps your new contribution neat and tidy.
Doing work on a feature branch helps avoid merge headaches later.
git branch new-feature
git checkout new-feature
git checkout -b new-feature
21. git add
Adds file(s) to the staging area to keep ready before committing changes.
Real world analogy: Boarding an airplane
git add <file(s)>
git status
22. git commit
Commit file(s) in the staging area to the repo history.
Real world analogy: Airplane takes off with all its passengers
git commit -m'Add commit message.'
git status
git log
Note: The commit exists in the local repo only at this point.
23. git push
Shares the local commit with a remote repo.
git push origin new-feature
Note: You must have "push" privileges to push to a remote repo.
24. Another feature
Update the local repo with upstream changes.
Create a new feature branch. Update the origin repo.
git checkout master
git checkout -b another-feature
git fetch upstream
git rebase upstream/master
git push origin another-feature
25. git add <files>
git commit -m"Add commit message"
git status
git log
git fetch upstream
git rebase upstream/master
git push origin another-feature
• Add changed files to staging area of
local repo.
• Commit changed files to local branch
and repo.
• Update (fetch and rebase) the local repo
with any upstream changes.
• Push feature branch to the origin repo.
Another feature: add, commit, fetch, rebase, push
26. – A N O N Y M O U S W S C A L U M N I
“Wow! Write, Speak, Code changes lives.
Remember you can go at your pace, ask questions,
make mistakes, learn, and have fun too. Believe.”
27. C O N T R I B U T E
Y O U R I D E A S M A T T E R . S H A R E T H E M . S U B M I T A P U L L R E Q U E S T.
28. Fact: Some projects are more welcoming and encouraging than others.
Myth: Your talent, potential, and future success are defined by a maintainer’s
response to your pull request.
Fact: Your PR may be rejected.
Fact: You may need to make changes based on constructive review
comments.
Myth: Maintainers are entitled to belittle a pull request or be crummy to you.
Fact: It’s not you. It’s them. And their loss. Find another project that values
your contribution.
L E T ’ S M A K E A P U L L R E Q U E S T
29. P re s s T h e P u l l R e q u e s t B u t t o n
C O N T R I B U T E A P R
30. Wr i t e A M e s s a g e A n d S u b m i t
C O N T R I B U T E A P R
31. T h e S u b m i t t e d P u l l R e q u e s t
C O N T R I B U T E A P R
36. Thank you.
P H O T O S :
C A R O L W I L L I N G , L I N N E A W I L L I N G
37. Y E S , Y O U C A N G I T !
I N T R O D U C T I O N T O G I T A N D G I T H U B
Carol Willing
@willingcarol
GitHub: willingc
W R I T E S P E A K C O D E
J U N E 1 7 , 2 0 1 6