Skip to content

Commit

Permalink
differences for PR #2
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 27, 2024
1 parent 91ce523 commit e61142d
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 1 deletion.
101 changes: 101 additions & 0 deletions 03-collaborative-git.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@

---
title: Collaborative Version Control
teaching: 180
exercises: 2
---

:::::::::::::::::::::::::::::::::::::::: questions

- How can I use version control to collaborate with others?

::::::::::::::::::::::::::::::::::::::::::::::::::


::::::::::::::::::::::::::::::::::::::: objectives

- Understand the basics of collaborative version control with git and Github
- Understand the difference between centralized and distributed workflows

::::::::::::::::::::::::::::::::::::::::::::::::::

# Collaborative version control with git and Github

### Instructor notes
Teaching is done as a pair of instructors.
Instructor A acts as the owner of the repository, instructor B as a collaborator (internal or external).

### Centralized workflow
First we show the centralized workflow all in the browser using Github:

* instructor A creates an issue (for example create ‘sum’ function)
* instructor B picks up the issue
* Instructor B creates a new branch (good to do this explicitly)
* Instructor B does some reviewable changes (a simple ‘sum’ function)
* Instructor B opens a new pull request.
* Instructor A reviews and approves the PR.
* Instructor B merges the pull request.
* Use Github repo’s insights -> network to visualize what just happened

::::::::::::::::::::::::::::::::::::::: challenge

### Exercise: Working as a project collaborator (in pairs):
#### Part 1
- PERSON A: Create an issue in the repository
- PERSON B: Clone this repository to your system
- PERSON B: Create a new branch
- PERSON B: Make the changes requested in the issue
- PERSON B: Push the changes to the remote repository on GitHub
- PERSON B: submit a Pull Request, refer to the issue (e.g. "Closes #1")

#### Part 2
- PERSON A: Review the Pull Request
- PERSON B: Address the comments
- PERSON A: Approve the Pull Request
- PERSON B: Merge the Pull Request
- (Optionally) Learn about [protecting branches](https://docs.github.com/en/github/administering-a-repository/about-protected-branches) and try it out.

::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::: solution



::::::::::::::::::::::::::::::::::::::::::::::::::

### Distributed workflow
Second we show distributed workflow. All in the browser using Github:
* Instructor A removes instructor B
* Instructor B now submits an issue
* Instructor A responds to issue asking instructor B to pick it up
* Instructor B forks repo, does some changes, and submits PR
* Instructor A reviews the changes
* Instructor B implements the changes
* Instructor A merges the pull request
* Use Github repo’s insights -> network to visualize what just happened

### Exercise: Working as an external contributor (in pairs)
#### Part 1
- PERSON A: Create an issue in Person B's repository
- PERSON A: Fork the repository to their own (= Person A's) account
- PERSON A: Clone the repository, make changes, push them back to the fork
- PERSON A: Submit a Pull Request from the fork to the original repository

#### Part 2
- PERSON B: Make a change in the original repository in the same place as person A's proposed changes
- PERSON A: Solve the merge conflict in the Pull Request
- PERSON B: Review/Approve the Pull Request
- PERSON B: merge the Pull Request
-
### Key Points
* Git and Github are superpowerful, not just for version control, but as tools for collaborative development
* Do code reviews and be constructive in them!
* Use centralized flow for internal collaborations
* Use distributed flow for external collaborations

:::::::::::::::::::::::::::::::::::::::: keypoints

- Centralized workflow is good for internal collaborations
- Distributed workflow is good for external collaborations

::::::::::::::::::::::::::::::::::::::::::::::::::
1 change: 1 addition & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ contact: 'team@carpentries.org' # FIXME
episodes:
- introduction.md
- 01-basics.md
- 03-collaborative-git.md

# Information for Learners
learners:
Expand Down
3 changes: 2 additions & 1 deletion md5sum.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"file" "checksum" "built" "date"
"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2024-03-27"
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2024-03-27"
"config.yaml" "f5840910962484623d0dedddfa30a95b" "site/built/config.yaml" "2024-03-27"
"config.yaml" "4248b3d9225baac97f6e54e5d4aa1f19" "site/built/config.yaml" "2024-03-27"
"index.md" "a02c9c785ed98ddd84fe3d34ddb12fcd" "site/built/index.md" "2024-03-27"
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2024-03-27"
"episodes/introduction.md" "6370d5592eae179125841d442e98df54" "site/built/introduction.md" "2024-03-27"
"episodes/01-basics.md" "a13034f7710cef398adb66aa0b2cb3b6" "site/built/01-basics.md" "2024-03-27"
"episodes/03-collaborative-git.md" "754372826a0b2dd0d6cdfb5ef5e6931a" "site/built/03-collaborative-git.md" "2024-03-27"
"instructors/instructor-notes.md" "cae72b6712578d74a49fea7513099f8c" "site/built/instructor-notes.md" "2024-03-27"
"learners/reference.md" "1c7cc4e229304d9806a13f69ca1b8ba4" "site/built/reference.md" "2024-03-27"
"learners/setup.md" "5456593e4a75491955ac4a252c05fbc9" "site/built/setup.md" "2024-03-27"
Expand Down

0 comments on commit e61142d

Please sign in to comment.