Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Please leave this repository open in a browser tab so that you can follow along

## Next

Next we will walk through the process of creating a Fork repository and setting up a local clone.
Next we will walk through the process of creating a GitHub Fork and local clone of this repository.

[Go](/walkthrough/1-setup.md)

Expand Down
2 changes: 1 addition & 1 deletion app/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
major=1
minor=0
patch=0
patch=1
8 changes: 4 additions & 4 deletions app/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ Welcome to _Flavor_, the only place on the planet where your taste buds won't be

## Picks of the Month

### [Cuba Pudding Jr.](writer/cuba-pudding-jr.md) | cubapud@flavor.magazine
### [Cuba Pudding Jr.](writer/cuba-pudding-jr.md)

[Grilled Peach Salad](recipe/jan/grilled-peach-salad.md)

### [Eggs Benny](writer/eggs-benny.md) | englishmuffin@flavor.magazine
### [Eggs Benny](writer/eggs-benny.md)

[Vanilla Panna Cotta](recipe/jan/vanilla-panna-cotta.md)

### [John Lemon](writer/john-lemon.md) | zestmaster@flavor.magazine
### [John Lemon](writer/john-lemon.md)

[Homemade Sausages](recipe/jan/homemade-sausages.md)

### [Madame Croque](writer/madame-croque.md) | mmecroque@flavor.magazine
### [Madame Croque](writer/madame-croque.md)

[Chocolate Soup](recipe/jan/chocolate-soup.md)
103 changes: 47 additions & 56 deletions walkthrough/1-setup.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 1. Setup

In order to contribute to a GitHub project, you will need two things: a Fork of the project and a local clone of your Fork.
In order to contribute to a GitHub project, you will need two things: a GitHub Fork and a local clone of this project.

## :running: Activities

Expand All @@ -15,19 +15,22 @@ Fork the source repository:
1. Visit https://github.com/source-username/repository-name.
2. Click the "fork" button, and choose your personal GitHub account if prompted.

---

:cop: :raised_hand: - Please wait until everyone has caught up.

:construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction: :construction:

---

### 2 - Clone your Fork

__All Team Members__

Fork the source repository:
1. Visit https://github.com/source-username/repository-name.
2. Click the "fork" button, and choose your personal GitHub account if prompted.

Clone your fork to your local machine:
Clone this project to your local machine:
```sh
$ cd ~/my/parent/directory
$ git clone https://github.com/username/repository-name.git
$ git clone https://github.com/source-username/repository-name.git
# clone the fork repository from GitHub

$ cd repository-name
Expand All @@ -40,16 +43,16 @@ $ git remote
origin

$ git remote -v
origin https://github.com/username/repository-name.git (fetch)
origin https://github.com/username/repository-name.git (push)
origin https://github.com/source-username/repository-name.git (fetch)
origin https://github.com/source-username/repository-name.git (push)
```

You should see an `origin` remote that points to your GitHub fork:
You should see an `origin` remote that points to the source GitHub project:
```sh
$ git remote show origin
* remote origin
Fetch URL: https://github.com/username/repository-name.git
Push URL: https://github.com/username/repository-name.git
Fetch URL: https://github.com/source-username/repository-name.git
Push URL: https://github.com/source-username/repository-name.git
HEAD branch: master
Remote branches:
develop tracked
Expand Down Expand Up @@ -88,66 +91,54 @@ $ git branch -a

---

### 3 - Add Remote for Source Repository
### 3 - Add Remote for your GitHub Fork

__All Team Members__

Add a `source` remote:
Add a `me` remote:
```sh
$ git remote add source https://github.com/source-username/repository-name.git
# add the source remote
$ git remote add me https://github.com/your-username/repository-name.git
# add the me remote

$ git remote -v
origin https://github.com/username/repository-name.git (fetch)
origin https://github.com/username/repository-name.git (push)
source https://github.com/source-username/repository-name.git (fetch)
source https://github.com/source-username/repository-name.git (push)
origin https://github.com/source-username/repository-name.git (fetch)
origin https://github.com/source-username/repository-name.git (push)
me https://github.com/your-username/repository-name.git (fetch)
me https://github.com/your-username/repository-name.git (push)
```

You should see a `source` remote that points to the upstream GitHub source repository:
You should see a `me` remote that points to your GitHub Fork repository:
```sh
$ git remote show source
* remote origin
Fetch URL: https://github.com/source-username/repository-name.git
Push URL: https://github.com/source-username/repository-name.git
$ git remote show me
* remote me
Fetch URL: https://github.com/your-username/repository-name.git
Push URL: https://github.com/your-username/repository-name.git
HEAD branch: master
Remote branches:
develop new (next fetch will store in remotes/source)
master new (next fetch will store in remotes/source)
develop new (next fetch will store in remotes/me)
master new (next fetch will store in remotes/me)
Local ref configured for 'git push':
master pushes to master (up to date)
```

Maintainers will need to create branches and push directly to the source repository.

All team members will need to pull changes from the source repository and merge them into
their own branches.
All team members will need to pull changes from the source repository in order to branch from for feature branches.

Fetch branch data from the `source` remote:
Fetch branch data from the `origin` remote:
```sh
$ git fetch source
$ git fetch origin
From https://github.com/source-username/repository-name
* [new branch] develop -> source/develop
* [new branch] master -> source/master
* [new branch] develop -> origin/develop
* [new branch] master -> origin/master

$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/develop
remotes/origin/master
remotes/source/develop
remotes/source/master

$ git remote show source
* remote source
Fetch URL: https://github.com/source-username/repository-name.git
Push URL: https://github.com/source-username/repository-name.git
HEAD branch: master
Remote branches:
develop tracked
master tracked
Local ref configured for 'git push':
master pushes to master (up to date)
remotes/me/develop
remotes/me/master
```

---
Expand All @@ -164,19 +155,19 @@ __All Team Members__

By now you should have noticed that you do not have a local `develop` branch
```sh
git branch
$ git branch
* master
```

Create a `develop` branch that tracks from your GitHub fork's `develop` branch:
Create a `develop` branch that tracks from `origin`'s `develop` branch:
```sh
git branch develop origin/develop
$ git checkout -b develop --track origin/develop
Branch develop set up to track remote branch develop from origin
```

Notice that viewing the details for the `origin` remote indicates that the local `develop` and `master` branches are configured to push to and pull from your GitHub fork's branches:
Notice that viewing the details for the `origin` remote indicates that the local `develop` and `master` branches are configured to push to and pull from the source GitHub repository's branches:
```sh
git remote show origin
$ git remote show origin
...
Local branches configured for 'git pull':
develop merges with remote develop
Expand All @@ -188,11 +179,13 @@ git remote show origin

:bulb: The `-vv` flag for the `git branch` command will also show the remote branches that are tracked by your local branches (in brackets):
```sh
git branch --vv
develop 3e03a92 [origin/develop] Create example app
* master 3e03a92 [origin/master] Create example app
$ git branch -vv
* develop 3e03a92 [origin/develop] Create example app
master 3e03a92 [origin/master] Create example app
```

You should now be ready to move on to the rest of the walkthrough. If you'd like to see the repository you've created on your local machine in GitHub desktop, you can add a repository by choosing a local path.

---

:cop: :raised_hand: - Please wait until everyone has caught up.
Expand All @@ -201,8 +194,6 @@ git branch --vv

---

You should now be ready to move on to the rest of the walkthrough. If you'd like to see the repository you've created on your local machine in GitHub desktop, you can add a repository by choosing a local path.

## Next

Next we will walk through the process of creating feature branches, publishing changes to GitHub, and making a request to merge changes into the source repository using a Pull Request.
Expand Down
43 changes: 18 additions & 25 deletions walkthrough/2-feature-branches.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,19 @@ Create a feature branch off of the `develop` branch that contains the writer's n
```sh
$ git checkout develop

$ git branch cuba-pudding-jr-feb

$ git branch
cuba-pudding-jr-feb
develop
* master
```

Next, switch to the newly created feature branch:
```sh
$ git checkout cuba-pudding-jr-feb
Switched to branch 'cuba-pudding-jr-feb'
$ git checkout -b cuba-pudding-jr-feb

$ git branch
* cuba-pudding-jr-feb
develop
master
```

:bulb: You can simplify the last two steps to create and switch to a branch with a single command:
:bulb: Feature branches will be named such that someone else can look at what branches are in progress and get a rough idea of what work is being done on each branch.

:bulb: You can create a branch without immediately checking out the branch via the `git branch` command:
```sh
$ git checkout -b cuba-pudding-jr-feb
Switched to a new branch 'cuba-pudding-jr-feb'
$ git branch cuba-pudding-jr-feb
```

---
Expand All @@ -62,11 +52,12 @@ Switched to a new branch 'cuba-pudding-jr-feb'

### 2 - Make Changes to the Project

__All Team Members___
__All Team Members__

In your text editor, make the following changes:

1. Add the new recipe under the [`/app/recipe/feb/`](/app/recipe/feb/) directory.
2. Update the writer's page in the [`/app/writer/`](/app/writer/) direcotry.
2. Update the writer's page in the [`/app/writer/`](/app/writer/) directory.
3. Update the main mage [`/app/index.md`](/app/index.md).

Since other people are going to be making changes at the same time, be careful not to make changes to lines of code that are not relevant to your change.
Expand All @@ -79,9 +70,9 @@ Since other people are going to be making changes at the same time, be careful n

---

### 3 - Diff Changes
### 3 - Review Changes

__All Team Members___
__All Team Members__

If you view the current git status, you will see 2 files with unstaged changes and a new folder that has not been tracked by git:
```sh
Expand Down Expand Up @@ -114,7 +105,7 @@ index ac3abad..9777cd5 100644
### [Cuba Pudding Jr.](writer/cuba-pudding-jr.md) | cubapud@flavor.magazine

-[Grilled Peach Salad](recipe/jan/grilled-peach-salad.md)
+[Quick Oatmeal Pancakes]( recipe/feb/quick-oatmeal-pancakes.md)
+[Quick Oatmeal Pancakes](recipe/feb/quick-oatmeal-pancakes.md)

### [Eggs Benny](writer/eggs-benny.md) | englishmuffin@flavor.magazine

Expand Down Expand Up @@ -147,9 +138,8 @@ If you see that you have changes to unexpected lines, please correct them at thi

Stage all of the changes that you've made thus far:
```sh
$ git add -A
# Careful, -A stages changes to all tracked files, untracks files that have been
# removed, and tracks files that have been added.
$ git add app/*
# Careful, using a wildcard adds any file that has changed that matches the pattern.

$ git status
On branch cuba-pudding-jr-feb
Expand Down Expand Up @@ -182,10 +172,13 @@ $ git commit -m "Adding Cuba Pudding Jr.'s Feb Recipe"

Now that your changes have been committed, let's get them published to your Fork on GitHub:
```sh
$ git push origin cuba-pudding-jr-feb
$ git push -u me HEAD
```

:bulb: Make sure you type the correct branch name.
:bulb: Specifying the HEAD reference instructs git to push to the same branch as the HEAD of your local project, which is currently your feature branch.

:bulb: The `-u` flag instructs git to link your local branch with the remote's branch so that future push & pull commands do not require you
to specify where you would like to push or pull code from.

Navigate to your Fork on Github, you should now see your new branch in the interface.

Expand Down
31 changes: 25 additions & 6 deletions walkthrough/3-code-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ __All Team Members__
Navigate to the source repository on GitHub, click the "Pull Requests" tab, and click on the Pull Request opened by the team member sitting to your right.

Review the following things:

1. Verify that the user is requesting to merge their feature branch into the `develop` branch.
2. Check to see if there is any important information on the Conversation tab.
3. Check the Commits tab to get a high-level view of the individual changes that were made.
Expand All @@ -42,14 +43,14 @@ If you are curious to run someone else's code locally, you will need to set up a

Create a remote pointing to the person to your right's Fork:
```sh
$ git remote add teammate https://github.com/teammmate-username/repository-name.git
$ git remote add teammate https://github.com/teammate-username/repository-name.git
# add the teammate remote

$ git remote -v
origin https://github.com/username/repository-name.git (fetch)
origin https://github.com/username/repository-name.git (push)
source https://github.com/source-username/repository-name.git (fetch)
source https://github.com/source-username/repository-name.git (push)
me https://github.com/your-username/repository-name.git (fetch)
me https://github.com/your-username/repository-name.git (push)
origin https://github.com/source-username/repository-name.git (fetch)
origin https://github.com/source-username/repository-name.git (push)
teammate https://github.com/teammate-username/repository-name.git (fetch)
teammate https://github.com/teammate-username/repository-name.git (push)
```
Expand All @@ -68,13 +69,31 @@ $ git branch -r --list teammate/*

Checkout a tracking branch:
```sh
$ git checkout -b teammate-feature-branch teammate/eggs-benny-feb
$ git checkout eggs-benny-feb
Branch teammate-feature-branch set up to track remote branch eggs-benny-feb from teammate.
Switched to a new branch 'teammate-feature-branch'
```

:bulb: As long as only one of your remotes has a branch called eggs-benny-feb, it knows to create a local tracking branch.

:bulb: If you do not wish to create a tracking branch, you can check out the branch in read-only mode by fully-specifying the branch instead (e.g., `teammate/eggs-benny-feb`)

Now you've switched the code in your directory to a branch containing all of the changes committed to your teammate's branch. If you have your project open in sublime or another text editor you will notice that the source files contain your teammate's changes.

If you run the `git log` command you can see a log of the latest commits made to the current branch:
```sh
$ git log
commit 6b7a7c2bc46753d0d394758b8fd04bcd3b4cf896
Author: My Teammate <teammate@gr8people.com>
Date: Mon Feb 8 12:58:20 2016 -0500

Adding Eggs Benny February Recipe

...
```

:bulb: Press enter to scroll through lines <kbd>&amp;</kbd> <kbd>Ctrl</kbd>+<kbd>C</kbd> to exit the log.

Once you are done, you can delete this branch:
```sh
$ git checkout develop
Expand Down
Loading