To give you a better idea of "real" GitHub workflows, I want you to fill out the below interview. Many open source projects have their source repositories available publicly on GitHub. They want to accept contributions from anyone, but they also have a few requirements:
- They don't want to allow direct push access to their repository, because they want to choose whether or not to accept the patch (perhaps they need to require a license agreement, or they want to make sure all tests pass before taking the patch)
- They want to be able to give feedback on the patch before accepting it (perhaps it violates coding standards, or is missing tests, etc.)
For these types of requirements, GitHub has the pull request process. Pull requests let a third party propopse a patch to the repository, and let reviewers (either human or machine) provide feedback and request additional changes for the patch.
There are multiple ways to make a pull request. For open source development, adding everyone who wants to send a pull request as a collaborator is infeasible (even if the fine-grained permissions to allow for "pull-request-proposer only" exist). So their pull request model more generally follows this pattern:
- User Bob wants to contribute to project "next-best-thing" (which is publicly available on GitHub). User Nancy is a "maintainer" of "next-best-thing". That means that Nancy has the rights to modify the repo (merging commits, rebasing, etc.).
- Bob starts by making a fork of "next-best-thing". That means he has a copy of "next-best-thing" in his GitHub account.
- Bob clones his "next-best-thing" repo to his local development environment (in your case this would be your Amazon workspace, cloning either through IntelliJ or the command line).
- Bob makes his modifications on his local copy (either on the default "master" branch or on a branch specific for this change).
- Bob pushes his changes to his fork of the repo. At this point, Bob can log into GitHub and see his changes. He is now prepared to create a pull request.
- Bob creates a pull request that is sent to the original repo that Nancy helps to maintain. Note that this is different than what you will typically do.
- Nancy reviews Bob's change, providing feedback. Frequently, Bob will have to update his pull request with more commits to address Nancy's concerns.
- Finally, Nancy is happy with Bob's pull request and merges it into the authoritative "next-best-thing" repository. At this point she can decide whether she wants to keep Bob's full commit history, or "squash" it into a single commit.
For this lab, you should play the role of Bob in the Overview section above. Fill out the Interview below, and send me a pull request when you're done!
For each question, please add your response to any other responses already recorded. Your answer should be formatted similar to the following sample:
Q1: Is this a question?
- Jeremy: yes it is
Q2: What is the answer?
- Jeremy: Of course, the answer is 42.
Hello! In the rush that is the start of the term, I really haven't had a chance to chat with many of you. So would you do me the favor of helping me get to know a bit about you by answering the following? Please avoid one word answers... I want to learn about you!
Q1: So you're finishing up your time in this CSCC program. Why did you decide to embark on this journey?
- Daniel: I wanted to learn and be able to utilize more with Java. Before this class, I was an analyst and now I'm a developer and want to use all of the information I've learned.
Q2: I love to travel. Tell me a bit about your favorite travel destination so far. What's on your travel bucket list?
- Daniel: My favorite place I've traveled so far has been Germany. They had beautiful scenery and architecture.
Q3: Name your favorite member of The Beatles, and your favorite Beatles song. You do know at least one Beatles song, right? If you are a Beatles fan, feel free to give me your top 5 or so.
- Daniel: My favorite member is Ringo Starr. I know the drummer, but I was a drummer too. My favorite song is I want to Hold Your Hand.
Q4: Do you have any pets? Species/Name/Details please. Murray wants to know... (he's not as smart as that picture makes him seem).
- Daniel: I currently don't have any pets. I grew up with mixed dogs but don't have any on my own. When my fiance moves in she's brining one of her cats named Kita and hopefully we will eventually get a Husky.
Once I have merged your pull request into my repo, please submit your repo along with a screenshot of your pull request in Blackboard.