Anonymous user
Github and Website Workshop/git-partner-programming: Difference between revisions
Github and Website Workshop/git-partner-programming (view source)
Revision as of 15:15, 6 March 2015
, 9 years agono edit summary
imported>Auria No edit summary |
imported>Auria No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1:
Welcome to
==Find a partner==
Line 6 ⟶ 5:
It's okay if you don't know them - you're all pretty cool (you're at the workshop, after all).
This partner is going to be
==Challenge==
Go through the follow steps with one person as “you” and the other as “partner”
When you’re finished, switch positions and repeat these steps (if you would like to)
'''You'''
* Go to your repository page on GitHub, click “Settings” (on the right-hand side) and select the “Collaborators” tab
* Search and add your partner’s GitHub username
'''Partner'''
* In the terminal, run git clone [your partner’s repo] to get a copy of their website code
* Challenge: style div.table-row and div.table-cell
** Hint: look at the W3 School’s documentation for the display property
* Commit and push the changes when you’re ready
'''You'''
* When someone else changes files in a repository, you can update the files on your computer using a command that works somewhat opposite to <tt>git push</tt>▼
* Enter this command: <tt>git pull</tt> in the terminal to get your partner’s changes▼
'''Partner'''
* Challenge: add padding between table-cells (give your partner an undesired value)
* Commit and push the changes when you’re ready
'''You'''
* Challenge: add padding between table-cells (use a desired value)
* Commit and push the changes when you’re ready
Bam, you will notice that there’s a merge conflict!
If you refresh portfolio.html, you will notice something along the lines of:
<code>
▲When someone else changes files in a repository, you can update the files on your computer using a command that works somewhat opposite to <tt>git push</tt>
<<<<<<< HEAD
[your change]
=======
[partner’s change]
>>>>>>> master
</code>
To resolve the conflict erase “<<<<<<< HEAD”, “=======”, and “>>>>>>> master” and keep erase [partner’s change]
▲Enter this command: <tt>git pull</tt>
Try pushing again - conflict solved.
Feel free to continue to contribute to each other's websites (using push and pull)!
[https://openhatch.org/wiki/Github_and_Website_Workshop/footer Next: Challenge 12]
|