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.
Before you begin
Section titled “Before you begin”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)”cd /path/to/your/sto-projectgit initConfirm:
git statusYou should see all your project files listed as untracked.
Step 2 — Create a .gitignore
Section titled “Step 2 — Create a .gitignore”Some files should not go into version control. Create a .gitignore in the project root:
# OS files.DS_StoreThumbs.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.
Step 3 — Review what you have
Section titled “Step 3 — Review what you have”Before committing everything, review the project:
git statusAll 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.
Step 4 — Stage everything
Section titled “Step 4 — Stage everything”git add .Then confirm what is staged:
git statusAll files should now show as “new file” under “Changes to be committed.”
Step 5 — The initial commit
Section titled “Step 5 — The initial commit”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:
git log --onelineYou should see a single commit.
Step 6 — Set the branch name
Section titled “Step 6 — Set the branch name”If your default branch is master rather than main, rename it now for consistency with GitHub’s defaults:
git branch -m master mainThis renames the local branch from master to main. If your branch is already main, skip this step.
What you have now
Section titled “What you have now”A local Git repository with:
- The complete STO project files tracked
- A
.gitignoreconfigured for the project type - A clean initial commit
- A
mainbranch
The next lesson creates the GitHub repository and connects them.
- Initialize Git with
git initif the STO folder is not already a repository. - Create
.gitignorebefore the first commit to keep OS and editor files out of history. - Review
git statusbefore staging — confirm nothing sensitive or unnecessary is included. - Stage everything with
git add ., then commit with a descriptive “Initial commit” message. - Rename
mastertomainif needed:git branch -m master main.
Next: creating the STO GitHub repository and connecting your local repo to it.