Skip to content

Commit 7de73b9

Browse files
author
Dan Croak
committed
Update rebasing/fetching in protocol guide
Functional changes: * Don't forget to fetch before rebasing. * Change Thin recommendation to Unicorn. * Remove `--rebase` due to discussion [here](thoughtbot/dotfiles#111). Improvements for better readability/documentation: * Replace `<>` style code comments with sentence instructions. * Use full options flags (`--verbose`, `--delete`, etc.) for clarity. * Use `<branch-name>` consistently (angle brackets and `-name` suffix).
1 parent eea029c commit 7de73b9

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

protocol/README.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Set up the app's dependencies.
5757
Use [Heroku config](https://github.com/ddollar/heroku-config) to get `ENV`
5858
variables.
5959

60-
heroku config:pull -r staging
60+
heroku config:pull --remote staging
6161

6262
Delete extra lines in `.env`, leaving only those needed for app to function
6363
properly. For example: `BRAINTREE_MERCHANT_ID` and `S3_SECRET`.
@@ -85,21 +85,25 @@ Write a feature
8585
Create a local feature branch based off master.
8686

8787
git checkout master
88-
git pull --rebase
89-
git checkout -b your-initials-new-feature
88+
git pull
89+
git checkout -b <branch-name>
90+
91+
Prefix the branch name with your initials.
9092

9193
Rebase frequently to incorporate upstream changes.
9294

9395
git fetch origin
9496
git rebase origin/master
95-
<resolve conflicts>
9697

97-
When feature is complete and tests pass, commit the changes.
98+
Resolve conflicts. When feature is complete and tests pass, stage the changes.
9899

99100
rake
100-
git add -A
101+
git add --all
102+
103+
When you've staged the changes, commit them.
104+
101105
git status
102-
git commit -v
106+
git commit --verbose
103107

104108
Write a [good commit message](http://goo.gl/w11us). Example format:
105109

@@ -112,9 +116,9 @@ Write a [good commit message](http://goo.gl/w11us). Example format:
112116

113117
Share your branch.
114118

115-
git push origin [branch]
119+
git push origin <branch-name>
116120

117-
Submit a [Github pull request](http://goo.gl/Kmdee).
121+
Submit a [GitHub pull request](http://goo.gl/Kmdee).
118122

119123
Ask for a code review in [Campfire](http://campfirenow.com).
120124

@@ -130,7 +134,7 @@ web interface or in Campfire.
130134

131135
For changes which they can make themselves, they check out the branch.
132136

133-
git checkout <branch>
137+
git checkout <branch-name>
134138
rake db:migrate
135139
rake
136140
git diff staging/master..HEAD
@@ -146,24 +150,25 @@ Merge
146150
Rebase interactively. Squash commits like "Fix whitespace" into one or a
147151
small number of valuable commit(s). Edit commit messages to reveal intent.
148152

153+
git fetch origin
149154
git rebase -i origin/master
150155
rake
151156

152157
View a list of new commits. View changed files. Merge branch into master.
153158

154-
git log origin/master..[branch]
159+
git log origin/master..<branch-name>
155160
git diff --stat origin/master
156161
git checkout master
157-
git merge [branch] --ff-only
162+
git merge <branch-name> --ff-only
158163
git push
159164

160165
Delete your remote feature branch.
161166

162-
git push origin :[branch]
167+
git push origin --delete <branch-name>
163168

164169
Delete your local feature branch.
165170

166-
git branch -d [branch]
171+
git branch --delete <branch-name>
167172

168173
Deploy
169174
------
@@ -174,19 +179,16 @@ View a list of new commits. View changed files. Deploy to
174179
git fetch staging
175180
git log staging/master..master
176181
git diff --stat staging/master
177-
git push staging master
178-
179-
Run migrations (if necessary).
180-
181-
heroku run rake db:migrate -r staging
182+
git push staging
182183

183-
Restart the dynos if migrations were run.
184+
If necessary, run migrations and restart the dynos.
184185

185-
heroku restart -r staging
186+
heroku run rake db:migrate --remote staging
187+
heroku restart --remote staging
186188

187189
[Introspect](http://goo.gl/tTgVF) to make sure everything's ok.
188190

189-
watch heroku ps -r staging
191+
watch heroku ps --remote staging
190192

191193
Test the feature in browser.
192194

@@ -195,10 +197,10 @@ Deploy to production.
195197
git fetch production
196198
git log production/master..master
197199
git diff --stat production/master
198-
git push production master
199-
heroku run rake db:migrate -r production
200-
heroku restart -r production
201-
watch heroku ps -r production
200+
git push production
201+
heroku run rake db:migrate --remote production
202+
heroku restart --remote production
203+
watch heroku ps --remote production
202204

203205
Watch logs and metrics dashboards.
204206

@@ -209,7 +211,7 @@ Set Up Production Environment
209211

210212
* Make sure that your
211213
[`Procfile`](https://devcenter.heroku.com/articles/procfile)
212-
is set up to run thin.
214+
is set up to run Unicorn.
213215
* Make sure the PG Backups add-on is enabled.
214216
* Create a read-only [Heroku Follower](http://goo.gl/xWDMx) for your
215217
production database. If a Heroku database outage occurs, Heroku can use the

0 commit comments

Comments
 (0)