Create a GitHub Account and Push Your Project
This page teaches you how to create a GitHub account, set up a repository, and push your Finance App project from your computer to GitHub.
By the end of this page, you will have:
- A GitHub account
- A repository for your project
- Your project files uploaded to GitHub
What Is GitHub and Why Do You Need It?
Section titled “What Is GitHub and Why Do You Need It?”GitHub is a website that stores your project code online. Think of it as a cloud folder for your website files.
You need GitHub because most hosting platforms — Cloudflare Pages, Vercel, Netlify — connect directly to GitHub. When you update your code on GitHub, your website updates automatically.
Step 1 — Create a GitHub Account
Section titled “Step 1 — Create a GitHub Account”- Open your browser and go to:
https://github.com/signup- Enter your email address. Use an email you check often.
- Create a strong password. GitHub will show a warning if the password is too weak.
- Choose a username. Use lowercase letters, numbers, and dashes. No spaces.
- Solve the visual puzzle to verify you are human.
- Check your email inbox. GitHub will send a launch code. Copy the code and paste it back into the browser.
- Your account is now created.
Important: Write down your username and password. You will need them later.
Step 2 — Create a New Repository
Section titled “Step 2 — Create a New Repository”A repository (repo) is a folder on GitHub where your project lives.
- Log in to GitHub
- Click the + button in the top right corner
- Select New repository
- Fill in the form:
| Field | What to Enter |
|---|---|
| Repository name | A short name, like finance-app |
| Description | Optional. Example: “My Finance App website” |
| Visibility | Choose Public or Private |
Important: Do NOT check “Add a README file”, “Add .gitignore”, or “Choose a license”. Leave them unchecked. Your project already has files, and adding these will cause conflicts later.
- Click Create repository
You will see a page with instructions and a URL. Keep this page open — you will need the URL in Step 6.
Step 3 — Install Git on Your Computer
Section titled “Step 3 — Install Git on Your Computer”Git is a tool that sends your files from your computer to GitHub.
- Go to:
https://git-scm.com- Download the version for your operating system (Windows, Mac, or Linux)
- Run the installer. Click Next on every screen — the default options are fine.
- Restart your terminal after installation
To confirm Git is installed, open a terminal and type:
git --versionYou should see a version number like git version 2.45.1.
Step 4 — Configure Git (One Time Only)
Section titled “Step 4 — Configure Git (One Time Only)”Tell Git who you are. Use the same email you used for GitHub.
Open a terminal and run these two commands one at a time:
git config --global user.name "Your Name"Replace Your Name with your actual name. Keep the quotes.
git config --global user.email "your-email@example.com"Replace your-email@example.com with the email you used for GitHub.
Step 5 — Open Your Project Folder in a Terminal
Section titled “Step 5 — Open Your Project Folder in a Terminal”-
Open a terminal:
- Windows: press
Win, typecmd, press Enter - macOS: press
Cmd + Space, typeterminal, press Enter - Linux: press
Ctrl + Alt + T
- Windows: press
-
Navigate to your project folder:
cd path/to/your/finance-appReplace path/to/your/finance-app with the actual path to your Finance App folder.
- Confirm you are in the right folder:
lsOn Windows, use dir instead of ls. You should see package.json and astro.config.mjs.
Step 6 — Connect Your Project to GitHub
Section titled “Step 6 — Connect Your Project to GitHub”Now you will link your local project to the GitHub repository you created in Step 2.
Initialize Git in your project
Section titled “Initialize Git in your project”Run:
git initThis tells Git to start tracking your project folder.
Add all your files
Section titled “Add all your files”Run:
git add .The dot . means “all files in this folder”.
Save your changes with a message
Section titled “Save your changes with a message”Run:
git commit -m "Initial commit"This saves a snapshot of your project.
Connect to your GitHub repository
Section titled “Connect to your GitHub repository”Go back to the GitHub page from Step 2. Copy the URL that looks like:
https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.gitRun this command, replacing the URL with your own:
git remote add origin https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.gitRename the branch to main
Section titled “Rename the branch to main”Run:
git branch -M mainPush your project to GitHub
Section titled “Push your project to GitHub”Run:
git push -u origin mainGitHub will ask for your username and password. Enter your GitHub username and password. If it asks for a token instead of a password, see the troubleshooting section below.
After the push finishes, refresh the GitHub page in your browser. You should see all your project files there.
Troubleshooting
Section titled “Troubleshooting”| Problem | Solution |
|---|---|
git command not found |
Restart the terminal after installing Git |
git remote add origin fails with “already exists” |
Run git remote set-url origin https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.git |
| Push rejected | The GitHub repo has files your local repo does not. Run git pull --rebase origin main, resolve any conflicts, then push again |
| GitHub asks for a token instead of password | GitHub no longer accepts account passwords for Git. Create a Personal Access Token in GitHub settings, and use that token as the password |
main branch does not exist |
Run git branch -M main first, then push |
| Permission denied | Make sure you are logged in to GitHub with the correct account |
After Pushing
Section titled “After Pushing”Your project is now on GitHub. You can:
- Share the repository URL with others
- Connect it to a hosting platform like Cloudflare Pages, Vercel, or Netlify
- Update your code later with
git add .,git commit -m "message", andgit push
Next Step
Section titled “Next Step”After pushing your project to GitHub, continue to the next section to deploy your site to a hosting platform.