Cycle of life

Follow the arrows

Your daily routine

Merge any approved PRs.

If you don’t merge your code it doesn’t show up in main.

Open your codespace

Make sure you are on the main branch.

If you are not on main, click the indicator and use the menu to change to main.

Make sure you’re synced up

Go to the version control tab.

If you see this, press the “Sync changes” button.

Otherwise

Sync up via ººº ⇨ Pull,Push ⇨ Sync.

This makes sure your Codespace has all the latest changes from your Github repository.

After you sync

You need to decide whether you’re starting a new project or continuing work on an existing project.

Starting a new project

start-project

Right click on the start-project file in the file explorer and choose “Open in Integrated Terminal”

Type

./start-project project-name kit-name

Replace project-name with whatever you want to call your project. It should be all lowercase and should not contain spaces or punctuation other than -.

Replace kit-name with one of the available starter kits.

Then hit return.

You should see

Kits

To see the available kits, type:

./start-project --list

You should see something like:

Help

Like many command line tools, you can run start-project with no arguments to get a message about how to use it:

Now you’re on a new project branch

start-project created a branch for your new project and a directory under the projects directory. It also fetched the starter code, installed some libraries you’ll need, and committed the starter code.

Now you can skip ahead to actually working.

Working on an existing project

Switch to the project branch

Click on the branch indicator and use the pop-up menu to choose the branch for the project you want to work on.

Ignore the ones that start with origin/

Actually working

Check the branch indicator

Whether you started a new project or switched to an existing project branch, the branch indicator should now show the project branch.

If so, you’re good to go.

Restart the web server

Right click on index.js in the new project directory and choose “Open in Integrated Terminal”. In the new terminal type:

node index.js

You should see:

A possible error

If you don’t see that, you may see someting like this:

This means the server is already running and can use the ports tab to open your browser.

Open preview

At the bottom right of the screen, this dialog should pop up:

You can choose either. For more involved web pages the browser is probably a better choice.

Help, I closed the tab!

If you close your browser tab, you can get back to it via PORTS.

Hover over the local address

Hover over the local address next to port 3000 to reveal some icons. Click the globe.

Code, code, code

Commit your changes

Whenever you make some interesting changes, you should commit them with a descriptive commit message. This makes it easier to see what you were doing and also creates checkpoints that you can go back to if you want to later.

Pushing

Committing just saves the state of your code locally (in your Codespace) but it is not yet on Github. To get the code to github you need to “push” it.

The easiest way to do that is by choosing “Commit & Push” rather than just “Commit”.

Publishing the branch

When you Commit & Push a new project branch, you may see this warning:

This is asking if you want to add a branch to Github to match the one you’re working on, which is exactly what you want so click, “Okay, Don’t Ask Again”.

Make a pull request

At the end of every class, go to the Github website and create a pull request for the branch you’ve been working on and request my review.

And then

Rest up for tomorrow.