-
Notifications
You must be signed in to change notification settings - Fork 3
Homework 03
originalgremlin edited this page Nov 1, 2012
·
3 revisions
While I don't want you to become too focused on git, we do have to learn it if we're to become an effective distributed development team. Git is a useful tool in every programmer's toolbox. But it's just another tool, not a goal in itself. With time and practice using git will help you achieve the real purpose of programming: making cool programs.
We've already practiced:
- cloning a repository
git clone <repo url> - listing existing branches
git branch - creating a new branch
git branch <branch name> - switch to a new active branch
git checkout <branch name>
This week we'll learn how to edit existing files and publish our changes.
- Switch to the coming-soon branch.
git checkout coming-soon - Download all the latest code from the remote repository.
git pull origin coming-soon - Open the file
my_first_push.txtin your favorite text editor. - Add your name to the bottom of the file.
- Save the file.
- What if somebody changed the file in the last 10 seconds? With distributed teams this is very possible. To be safe, we usually try to download any recent changes just before uploading our own.
git pull origin coming-soon - Tell git about your changes.
git add my_first_push.txt - Verify that everything is correct. You should see
my_first_push.txtlisted as a changed file.
git status - Save your changes locally with an informative message so everybody knows just what changed.
git commit -m "Added my name." - Upload your local changes to the remote server so your classmates can see them.
git push origin coming-soon
Continue your lessons on Code Academy. Spend at least another hour going through the activities.
Download these books and read the first 3 chapters of JavaScript: The Good Parts. Along with online documentation, these will form the core references for this class.