Github and Website Workshop/git-partner-programming: Difference between revisions

no edit summary
imported>Auria
(Created page with "Welcome to the the seventh step of the [https://openhatch.org/wiki/Github_and_Website_Workshop Github and Website Workshop] - partner up! ==Find a partner== It's okay if you...")
 
imported>Auria
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1:
Welcome to theChallenge the seventh step11 of the [https://openhatch.org/wiki/Github_and_Website_Workshop Github and Website Workshop] - partner up!
 
==Find a partner==
Line 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 lookinghelping atyou yourimplement websitediv.table-row and helping you work on itdiv.table-cell
 
==Challenge==
 
Go through the follow steps with one person as “you” and the other as “partner”
==Push your code==
 
When you’re finished, switch positions and repeat these steps (if you would like to)
Right now you have made some commits - but no one else can see these changes yet. To have them show up on GIthub, you need to "push" your code.
 
'''You'''
First let's discuss a few concepts related to this push command:
* 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'''
* You are putting changes from your computer to the ''remote server''. Usually the remote server, the place on Github where your files can be viewed, is called <tt>origin</tt>.
* In the terminal, run git clone [your partner’s repo] to get a copy of their website code
* There is a concept called branching in git which lets you work on multiple changes at the same time. We will not be talking about branches in this workshop, but it helps to know that the ''branch'' you are working on is called <tt>master</tt> - the master branch (ruler of them all)
* Challenge: style div.table-row and div.table-cell
* To send all your changes to the master branch on the remote server, type <tt>git push origin master</tt>. It's possible that the first time you do this git will ask you for some more information. If this happens please let a mentor know and we'll help you out!
** Hint: look at the W3 School’s documentation for the display property
* Commit and push the changes when you’re ready
 
'''You'''
Now go to the repository on Github.com and take a look at your changes there!
* 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'''
==Clone someone else's code==
* 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!
[https://openhatch.org/wiki/Github_and_Website_Workshop/fork_a_template Earlier], you put your repository from Github into a folder on your computer.
 
If you refresh portfolio.html, you will notice something along the lines of:
See if you can follow the same steps to put your partner's repository in another folder on your computer.
 
<code>
You do NOT need to fork this repository - start after this step. (Fork creates a completely separate copy, and you want their code and their repository on your computer)
<<<<<<< HEAD
[your change]
=======
[partner’s change]
>>>>>>> master
</code>
 
To resolve the conflict erase “<<<<<<< HEAD”, “=======”, and “>>>>>>> master” and keep erase [partner’s change]
 
Try pushing again - conflict solved.
==Edit each other's code==
 
Feel free to continue to contribute to each other's websites (using push and pull)!
Talk with each and talk about things you'd think could be better. Change anything you like!
 
[https://openhatch.org/wiki/Github_and_Website_Workshop/footer Next: Challenge 12]
Work on this for about 15 minutes.
 
==commit and push==
 
Commit your code and push it back to the remote server. Now you can bring the changes to your own website back to your own computer.
 
==pull in changes==
 
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>
 
Make sure your files are updated, and continue to the next lesson.
 
Feel free to continue to contribute to each other's websites (using push and pull)!
Anonymous user