├── images
├── 2step12GitFlow.png
├── 2step14GitFlow.png
├── 2step16GitFlow.png
├── 2step3GitFlow.png
├── 2step7GitFlow.png
├── 2step9GitFlow.png
├── heading-after.png
├── heading-before.png
├── step1GitFlow.png
├── step5GitFlow.png
├── step6GitFlow.png
├── step7GitFlow.png
├── step9GitFlow.png
├── pull-request-tab.png
├── step3(1)GitFlow.png
├── step3(2)GitFlow.png
├── 2step13(1)GitFlow.png
├── 2step13(2)GitFlow.png
├── pull-request-open.png
├── github-pages-settings.png
├── clone-repository-dialog.png
├── git-flow-summary-table.png
└── Gitflow diagrams.xml
└── README.md
/images/2step12GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/2step12GitFlow.png
--------------------------------------------------------------------------------
/images/2step14GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/2step14GitFlow.png
--------------------------------------------------------------------------------
/images/2step16GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/2step16GitFlow.png
--------------------------------------------------------------------------------
/images/2step3GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/2step3GitFlow.png
--------------------------------------------------------------------------------
/images/2step7GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/2step7GitFlow.png
--------------------------------------------------------------------------------
/images/2step9GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/2step9GitFlow.png
--------------------------------------------------------------------------------
/images/heading-after.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/heading-after.png
--------------------------------------------------------------------------------
/images/heading-before.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/heading-before.png
--------------------------------------------------------------------------------
/images/step1GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/step1GitFlow.png
--------------------------------------------------------------------------------
/images/step5GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/step5GitFlow.png
--------------------------------------------------------------------------------
/images/step6GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/step6GitFlow.png
--------------------------------------------------------------------------------
/images/step7GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/step7GitFlow.png
--------------------------------------------------------------------------------
/images/step9GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/step9GitFlow.png
--------------------------------------------------------------------------------
/images/pull-request-tab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/pull-request-tab.png
--------------------------------------------------------------------------------
/images/step3(1)GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/step3(1)GitFlow.png
--------------------------------------------------------------------------------
/images/step3(2)GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/step3(2)GitFlow.png
--------------------------------------------------------------------------------
/images/2step13(1)GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/2step13(1)GitFlow.png
--------------------------------------------------------------------------------
/images/2step13(2)GitFlow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/2step13(2)GitFlow.png
--------------------------------------------------------------------------------
/images/pull-request-open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/pull-request-open.png
--------------------------------------------------------------------------------
/images/github-pages-settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/github-pages-settings.png
--------------------------------------------------------------------------------
/images/clone-repository-dialog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/clone-repository-dialog.png
--------------------------------------------------------------------------------
/images/git-flow-summary-table.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foundersandcoders/git-workflow-workshop-for-two/HEAD/images/git-flow-summary-table.png
--------------------------------------------------------------------------------
/images/Gitflow diagrams.xml:
--------------------------------------------------------------------------------
1 |
39 |
40 | ```sh
41 | $ git clone 'PASTE THE URL OF YOUR REPOSITORY HERE'
42 | ```
43 |
44 | 3. Move into the newly created directory.
45 |
46 | ```sh
47 | $ cd your-repo-name-here
48 | ```
49 | This is what your remote and local repositories look like after this. HEAD is a reference to your current location.
50 |
51 |
52 |
53 | ## Step 2 - Raise your issues on the work to be done
54 |
55 | Normally, you would decide on which "features" you were going to build and then break these down into smaller issues before starting the work.
56 |
57 | For the sake of this exercise, we're just going to [add one issue](https://help.github.com/articles/creating-an-issue/) at the moment. Your client wants a beautifully styled heading for the homepage. It should be simple, bold, black writing with a background shadow that makes it stand out.
58 |
59 | 1. Raise a new issue with a descriptive title.
60 |
61 | 2. In the body of the issue, provide more detail about how to complete the work.
62 |
63 | 3. Assign yourselves to this issue.
64 |
65 |
66 |
67 |
68 |
69 | ## Step 3 - Create and move to a new branch
70 |
71 | There are many types of workflow. At FAC, we use [the GitHub flow](https://guides.github.com/introduction/flow/), where the `master` [branch](](https://help.github.com/articles/about-branches/)) is always deployable. In this flow, each branch is used for a separate feature.
72 |
73 | 1. Create a branch with a unique and descriptive name. For example, `create-heading-with-shadow`.
74 |
75 | ```sh
76 | $ git branch create-heading-with-shadow
77 | ```
78 |
79 |
80 | 2. Leave the master branch by switching to the new branch you have just created.
81 |
82 | ```sh
83 | $ git checkout create-heading-with-shadow
84 | ```
85 |
86 |
87 |
88 |
89 | ## Step 4 - Write enough HTML & CSS to satisfy the requirements
90 |
91 | 1. Add the following code into a file called `index.html`.
92 | ```html
93 |
94 |
95 |
96 |
144 |
145 |
146 | ## Step 6 - Commit your changes
147 |
148 | The history of a project is made up of ["commits"](https://stackoverflow.com/questions/2745076/what-are-the-differences-between-git-commit-and-git-push). Each commit is a snapshot of your whole repository at one particular time.
149 |
150 | 1. Commit the files that are in the staging area.
151 |
152 | Before closing the commit message with a quote symbol you can press enter on your keyboard to continue typing in the new terminal line. The text in the second line can be used as an additional message.
153 |
154 | It is a good practice to link your commit to an existing issue by typing `Relates #1`. Thanks to using the hash symbol followed by the relevant issue number your commit will be [automatically linked to an existing issue](https://help.github.com/articles/autolinked-references-and-urls/).
155 |
156 | ```sh
157 | $ git commit -m 'add git workshop heading & shadow styling
158 | > Relates #1'
159 | ```
160 |
161 |
162 |
163 | ## Step 7 - Push your local version up to GitHub
164 |
165 | At this point, your remote repo looks exactly the same as at the beginning. You need to push your changes.
166 |
167 | 1. [Push](https://help.github.com/articles/pushing-to-a-remote/) the `create-heading-with-shadow` branch up to the "origin" i.e. the GitHub repo that you cloned from.
168 |
169 | ```sh
170 | $ git push origin create-heading-with-shadow
171 | ```
172 |
173 |
174 |
175 |
176 | ## Step 8 - Create a pull request
177 |
178 | 1. Programmer 1 navigates to the repository on GitHub.com and creates a [pull request](https://help.github.com/articles/creating-a-pull-request/#creating-the-pull-request).
179 |
180 | + Add a descriptive title (e.g. `Create page heading`) and leave a comment linking the pull request to the issue.
181 |
182 | + Select Programmer 2 as an [assignee](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/).
183 |
184 |
185 |
186 |
187 |
188 |
189 | ## Step 9 - Programmer 2 merges the pull request :+1:
190 | You should never merge your own pull requests. A PR gives the rest of your team the chance to review before your changes are merged into `master`. In your projects, you will be asking the other pair to do this.
191 |
192 | 1. Programmer 2 reviews the changes and [merges the pull request](https://help.github.com/articles/merging-a-pull-request/#merging-a-pull-request-on-github) on GitHub.com.
193 |
194 |
195 |
196 | Now your remote repo looks like this:
197 |
198 |
199 |
200 |
201 | # Splitting the work
202 | Your client has just called you and asked to improve heading on their [company website](https://piotrberebecki.github.io/git-workflow-workshop-for-two/).
203 |
204 | There are two issues that when resolved will make the heading look really nice:
205 |
206 | 1. Spelling mistake in the heading (the word 'WORKSHOW' should be replaced with 'WORKSHOP')
207 | 1. The name of the css class in the heading needs to be updated so that existing styles in the `style.css` file can take effect (`class="some-heading"` should be replaced with `class="page-heading"`).
208 |
209 | Current heading:
210 |
211 |
212 |
213 | When you apply the two changes above the heading will look like this:
214 |
215 |
216 |
217 |
218 | You decide that one of you **(Programmer 1) will resolve issue number 1** while the other person **(Programmer 2) will resolve issue number 2**. When you begin working on your weekly projects, you will always be pairing. So programmer 1 represents "pair 1" and programmer 2 represents "pair 2".
219 |
220 | **Note: Only one line in the `index.html` file needs to be modified.**
221 |
222 |
223 |
224 | ## Step 1 - Programmer 2 clones the repo
225 |
226 | 1. Make sure both teammates have a cloned, so you each have a local version on your own computer
227 |
228 | ```sh
229 | $ git clone 'PASTE THE URL OF YOUR REPOSITORY HERE'
230 | ```
231 |
232 |
233 |
234 |
235 | ## Step 2 - Raise these 2 new issues
236 |
237 | 1. Create the following two issues and assign each one to a different person
238 |
239 | + `Fix spelling typo in
269 |
270 |
271 | ## Step 4 - Both programmers open their `index.html` files and make one requested change each
272 |
273 | 1. **Programmer 1 fixes only the spelling typo** in the heading (WORKSHOW -> WORKSHOP). Please do not update the class name. This is dealt with by Programmer 2.
274 |
275 | ```html
276 |
326 |
327 |
328 | ## Step 8 - Programmer 1 switches to `master` branch and pulls down the remote `master` branch
329 | We have so many programmers working on this project now, who knows what changes may have happened to the `master` branch since the last time we looked at the remote version that's on GitHub?
330 |
331 | 1. Programmer 1 switches to `master` branch.
332 |
333 | ```sh
334 | $ git checkout master
335 | ```
336 |
337 | 1. Programmer 1 [pulls](https://git-scm.com/docs/git-pull) the `master` branch from the remote (GitHub repo) to make sure that the local version of `master` is up to date with the remote (GitHub) version of `master`. (There should be no changes since neither of you has pushed any changes to the remote yet.) **It is a good practice to regularly check for changes on the remote before pushing your local changes.**
338 |
339 | ```sh
340 | $ git pull origin master
341 | ```
342 |
343 | 1. Programmer 1 switches back to the `fix-typo-heading` branch.
344 |
345 | ```sh
346 | $ git checkout fix-typo-heading
347 | ```
348 |
349 |
350 |
351 |
352 | ## Step 9 - Programmer 1 pushes `fix-typo-heading` branch to remote
353 |
354 | 1. Programmer 1 [pushes](https://help.github.com/articles/pushing-to-a-remote/) `fix-typo-heading` branch to remote
355 |
356 | ```sh
357 | $ git push origin fix-typo-heading
358 | ```
359 |
360 |
361 |
362 |
363 | ## Step 10 - Programmer 1 creates a pull request
364 |
365 | 1. Programmer 1 navigates to the repository on GitHub.com and creates a [pull request](https://help.github.com/articles/creating-a-pull-request/#creating-the-pull-request).
366 |
367 | + Add a descriptive title (e.g. `Fix the spelling mistake in page heading`) and leave a comment linking the pull request to the issue.
368 |
369 | + Select Programmer 2 as an [assignee](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/).
370 |
371 |
372 |
373 |
374 |
375 |
376 | ## Step 11 - Programmer 2 reviews the pull request
377 |
378 | Programmer 2 [reviews the pull request](https://help.github.com/articles/about-pull-request-reviews/)
379 |
380 | 1. Step through each commit (in this case one)
381 |
382 | 2. Check the "Files changed" tab for a line-by-line breakdown.
383 |
384 | 2. Click "Review changes" and choose:
385 | + "Comment"
386 | + "Approve"
387 | + "Request changes"
388 |
389 |
390 |
391 |
392 | ## Step 12 - Programmer 2 merges the pull request :+1:
393 |
394 | 1. Programmer 2 [merges the pull request](https://help.github.com/articles/merging-a-pull-request/#merging-a-pull-request-on-github) on GitHub.com.
395 |
396 |
397 |
398 | 2. Programmer 2 opens the live website on GitHub pages to double check that the spelling mistake has been corrected. Go to the repository settings on Github and scroll down until you find Github Pages title. Select the master branch as the source and save, and you'll then see the URL where the live website is.
399 |
400 |
401 |
402 |
403 |
404 | ## Step 13 - Programmer 2 switches to `master` branch, pulls the remote `master` branch, tries to merge it into `update-class-heading` branch and :collision: resolves merge conflicts :collision:
405 |
406 | 1. Programmer 2 switches to `master` branch.
407 |
408 | ```sh
409 | $ git checkout master
410 | ```
411 |
412 | 2. Programmer 2 [pulls](https://git-scm.com/docs/git-pull) the remote `master` branch to make sure that the latest version of the project is available locally.
413 |
414 | ```sh
415 | $ git pull origin master
416 | ```
417 |
418 |
419 |
420 | 3. Programmer 2 switches back to the `update-class-heading` branch.
421 |
422 | ```sh
423 | $ git checkout update-class-heading
424 | ```
425 |
426 | 4. Programmer 2 tries to merge `master` branch into `update-class-heading` branch.
427 |
428 | ```sh
429 | $ git merge master
430 | ```
431 |
432 | 5. There should be a :collision: merge conflict :collision: since the line with the `
468 |
469 |
470 | ## Step 14 - Programmer 2 pushes `update-class-heading` branch to remote
471 |
472 | 1. Programmer 2 [pushes](https://help.github.com/articles/pushing-to-a-remote/) `update-class-heading` branch to remote.
473 |
474 | ```sh
475 | $ git push origin update-class-heading
476 | ```
477 |
478 |
479 |
480 |
481 |
482 | ## Step 15 - Programmer 2 creates a pull request
483 |
484 | 1. Programmer 2 navigates to the repository on GitHub.com and creates a [pull request](https://help.github.com/articles/creating-a-pull-request/#creating-the-pull-request) selecting `master` as a base branch and `update-class-heading` as a head branch. Please add a descriptive title (e.g. `Update class name in page heading`) and leave a comment linking the pull request with the issue `#
494 |
495 | 2. Programmer 1 opens the live website on GitHub pages to double check the new heading style.
496 |
497 |
498 |
499 |
500 |
501 |
502 | ## That's it 😄 Thank you for checking out the 'Git Workflow Workshop for Two Programmers' :clap:
503 |
504 | ***A summary of the above commands and what they do can be found [here](/images/git-flow-summary-table.png) in a neat little table.***
505 |
506 |
507 | **Note**: This workshop does not introduce the very popular idea of forking a repository, which is very useful when wanting to contribute to existing open source projects 💯. Forking is not required when starting a new repository under `foundersandcoders` or `FAC-X` organisations since all your fellow students will be automatically added as contributors.
508 |
509 | Having said that, we recommend you read about forking to be able to contribute to open source projects. You can read more about it [here](https://help.github.com/en/articles/fork-a-repo).
510 |
--------------------------------------------------------------------------------