Skip to content

Preparing the STO Repository

The Summit Trail Outfitters site you built throughout this learning path is a real project. In this module, you will publish it to GitHub as your first portfolio piece. This lesson covers getting the local STO folder into a clean, publishable state.

Locate your STO project folder — the one containing index.html, about.html, contact.html, trails.html, gear.html, 404.html, and the css/, js/, and images/ directories.

If it already has a .git directory from earlier work, you are ahead — run git status to see where things stand. If it does not, you will initialize Git now.

Step 1 — Initialize Git (if not already done)

Section titled “Step 1 — Initialize Git (if not already done)”
Terminal window
cd /path/to/your/sto-project
git init

Confirm:

Terminal window
git status

You should see all your project files listed as untracked.

Some files should not go into version control. Create a .gitignore in the project root:

# OS files
.DS_Store
Thumbs.db
# Editor directories
.vscode/
.idea/
# Node modules (if you ever add a build step)
node_modules/

For a static HTML/CSS/JS project, there is not much to ignore — mostly OS metadata files and editor configuration. The important thing is to create the .gitignore before the first commit so these files never enter the repository’s history.

Before committing everything, review the project:

Terminal window
git status

All your HTML, CSS, JS, and image files should appear as untracked. The .gitignore file should also appear (it needs to be committed so Git knows about it).

Check that there are no files you do not want in the repository — password files, local configuration with credentials, large binary exports. If you find any, add them to .gitignore before continuing.

Terminal window
git add .

Then confirm what is staged:

Terminal window
git status

All files should now show as “new file” under “Changes to be committed.”

Terminal window
git commit -m "Initial commit — Summit Trail Outfitters site"

Convention for the first commit is “Initial commit” plus a brief description. It does not need a body — there is no “why” beyond “this is where the project began.”

Confirm:

Terminal window
git log --oneline

You should see a single commit.

If your default branch is master rather than main, rename it now for consistency with GitHub’s defaults:

Terminal window
git branch -m master main

This renames the local branch from master to main. If your branch is already main, skip this step.

A local Git repository with:

  • The complete STO project files tracked
  • A .gitignore configured for the project type
  • A clean initial commit
  • A main branch

The next lesson creates the GitHub repository and connects them.

  • Initialize Git with git init if the STO folder is not already a repository.
  • Create .gitignore before the first commit to keep OS and editor files out of history.
  • Review git status before staging — confirm nothing sensitive or unnecessary is included.
  • Stage everything with git add ., then commit with a descriptive “Initial commit” message.
  • Rename master to main if needed: git branch -m master main.

Next: creating the STO GitHub repository and connecting your local repo to it.