As you start each lab in the series you are strongly encouraged to:
- start from the previous solutions and build on them
- do your work on your own new local branch
ACHTUNG! do not FORK this repo; just CLONE it.
Follow these steps only on your first sprint!
- For sprint 1, after you clone the repo, make sure you're on a personal local branch.
git checkout -b my_work_sprint_1
git checkout -b
creates a new, local branch from the current branch.
Follow these steps on every sprint except the first one!
Why? You likely have changes from previous sprints that need to be committed first!
Here's how you can do that:
Let's assume you're starting sprint 2
-
Commit any changes you've made.
git add . git commit -m "saving my changes on sprint X"
Then verify that the above worked. If
git status
shows that your working directory is clean you're good to go! -
Check out the next solution branch using
git checkout REMOTE/BRANCH_NAME
. Note that our remote isorigin
if you cloned the repo.git checkout origin/solutions_sprint_1
If you're starting sprint 2, use the solutions from 1 as your starting point. Using
origin/BRANCH_NAME
says to use origin's copy of that branch, ignoring any local changes you may have made. -
Create a new branch for your work in this sprint.
git checkout -b my_work_sprint_2
git checkout -b
creates a new, local branch from the current branch. -
Begin working! Make all your commits on YOUR branch.
If at some point we tell you that you need updated solutions follow these instructions.
-
Before you checkout the solution branch; fetch the data from
origin
git fetch origin
-
Follow the instructions in [subsequent sprints](#Subsequent Sprints)
When you checkout make sure that you specify that you want the copy from the remote by prepending
origin/
to the branch name. e.g.:git checkout origin/solutions_sprint_3The instructions above already use
origin/
, so if you follow them it should just work.