If you don’t merge your code it doesn’t show up in main
.
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
.
Go to the version control tab.
If you see this, press the “Sync changes” button.
Sync up via ººº ⇨ Pull,Push ⇨ Sync.
This makes sure your Codespace has all the latest changes from your Github repository.
You need to decide whether you’re starting a new project or continuing work on an existing project.
start-project
Right click on the start-project
file in the file explorer and choose “Open in Integrated Terminal”
./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.
To see the available kits, type:
./start-project --list
You should see something like:
Like many command line tools, you can run start-project
with no arguments to get a message about how to use it:
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.
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/
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.
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:
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.
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.
If you close your browser tab, you can get back to it via PORTS.
Hover over the local address next to port 3000 to reveal some icons. Click the globe.
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.
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”.
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”.
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.
Rest up for tomorrow.