Anda di halaman 1dari 10

Lecture 8

Github and Contributing to Open Source


Sign in on the
attendance
sheet!

Upcoming Schedule
3/29 (today): Cherry-pick, Github, Git workflows
4/5: Git Internals
4/12: No Class (Carnival)
4/19: Final
4/26: Handback finals, ????

Scenario: another branch has a commit you want,


but youre not ready to merge or rebase them
together
master,
HEAD

sql-hotfix
E

F
develop

Scenario: another branch has a commit you want,


but youre not ready to merge or rebase them
together
master,
HEAD

Solution: copy
over just the
one commit you
want
cherry-picking

F
sql-hotfix
E

F
develop

git cherry-pick <commit hash>


Example use:
git cherry-pick e25a68a
Copies the commit specified by <commit hash> and applies it to the
current branch.

Branching Models
Git is a version control system, but doesnt specify a style of how to
version control
Different people and projects have preferences for how to organize
branches and commits

Small projects: a linear model


e167179: Bob: fix
compilation

6f96cf3: Alice: more


bugfixes

b5f3729: Alice: Bob


you screwed up

8277e09: Bob: okay


actually works now
master,
HEAD

8b7d883: Bob: a bugfix


for that feature

All the commits go on one branch - master


8fc42c6: Alice: heres
a feature I made
Example: https://github.com/atom/language-json
b4e2c29: initial
commit

Master-Develop Model
master,
HEAD

develop

8277e09: Bob: okay


actually works now

236eca3: Alice: more


bugfixes, release 1.0.1

b5f3729: Alice: Bob


you screwed up
e167179: Bob: fix
compilation

6f96cf3: Alice: more


bugfixes, release 1.0

5f969f3: Alice: more


bugfixes
8b7d883: Bob: a bugfix
for that feature

Example:
https://github.com/Aluxian/Fac
ebook-Messenger-Desktop

8fc42c6: Alice: heres


a feature I made
b4e2c29: initial
commit

A more scalable model


http://nvie.com/posts/a-successful-git-branching-model/
Examples:
https://github.com/autolab/autolab (hotfix branches)
https://github.com/atom/atom (feature, release branches)
https://github.com/ocaml/ocaml (feature, release branches)

Contributing to Open Source


https://guides.github.com/activities/contributing-to-opensource/index.html

Anda mungkin juga menyukai