My First Website Part 5 Plus
25 Mar 2017 • eugene
This is an improved version of our process for working on the My First Website kata. We use this process to make sure we don't lose our work.
1. Pull Changes from Server
- Open Git Bash.
- Change to your repository's directory.
$ cd (make sure we're in the home directory)
$ cd Documents/workspace/dojo2017q1
- Check if local repository is clean.
$ git status
- If the last two lines of the command's output matches the example above, skip to Step 6.
- Uh-oh, someone did not save their work and left the repository dirty. Let's disregard all the un-pushed changes (make sure you use the current branch name, not elvis).
$ git reset --hard origin/elvis
- Pull the latest changes from the server to your local copy.
$ git pull origin
- Now checkout your own branch.
$ git checkout elvis (replace
elvis with your branch name)
- Make sure the local copy is up-to-date with the server's.
$ git pull
- Now merge in the latest updates from your mentor in the
$ git merge master
- If a Merge message pops-up like that shown, we'll just accept the default message.
The message is displayed in an old fashioned editor named VI. We'll learn more about VI in another kata. For now, let's just accept this message and type in the following exactly:
[enter]. If the letters don't appear at the bottom of the screen as you type them, press the
[esc] key, then try again.
- Done! Minimize the Git Bash window.
2. Do Some Coding
Continue your work on the My First Website kata. Get a physical copy from your mentor. Optionally, you can check out the copy in your repository named
My_first_website.pdf or download it here.
3. Push Your Changes to Server
- Re-select the Git Bash window.
- Review the files that have changed:
- Stage your files for commit:
git add --all
git status (notice that your files are staged, in-green)
- Now commit your changes with a message to help your remember the work you performed today:
git commit -m 'Finished card 3 today!'
(replace the message in quotes after the
-m with your own!)
- And push them to the server (replace
elvis with your branch name):
git push origin elvis