My First Website Part 2
18 Feb 2017 • eugene
1. Update your Repository
Last week you setup your own exact copy of the dojo's repository. At the start of each session you need to pull in the latest updates (i.e. this week we added notes).
- Open Git Bash (use Windows button on bottom left).
- Go to your repository's directory in the file system:
$ cd Documents/workspace/dojo2017q1
Tip: Type first few characters of directory name, then use the
tab key.
- Check the status of the repository:
$ git status
(note the selected branch)
- Checkout the
master
branch:
$ git checkout master
- Get the latest updates:
$ git pull origin master
Git pulls an exact copy of all the changes that occurred since
your last pull from the server!
- Now switch back to our personal branch created last week (remember to use your own name in-place of
elvis
):
$ git checkout elvis
- Now merge in the latest updates from the master branch:
$ git merge master
Git merges-in the latest updates from the master into your branch!
- Your branch is now up-to-date with dojo's master repository!
2. Do Some Coding
Using the handout from your mentor, start with Card 1. There is a copy in the repository named My_first_website.pdf
, also available online here.
3. Save Your Work
At the end of class, we need to save our work. This is easy in Git!
- Open Git Bash (use Windows button on bottom left).
- Go to your repository's directory in the file system:
$ cd
(make sure we're in the home directory)
$ cd Documents/workspace/dojo2017q1
- Review the files that have changed:
git status
- Stage your files for commit:
git add --all
git status
(notice that your files are staged, in-green)
- Now commit (save) your changes:
git commit -m 'My first commit!'
- And push them to the server (replace
elvis
with your branch name): git push origin elvis
- Done!
Posts