Zero-Code AI App BuilderZero-Code AI App Builder
Builder Foundations

Push your project

Upload your work to GitHub

Your commits are on your computer, and an empty repo is waiting on GitHub. Now let's connect them and upload your work.

What is pushing?

Pushing is like syncing your phone photos to the cloud. Your commits travel from your computer to GitHub. Pulling is the opposite: you download new commits from GitHub to your computer.

  • Remote: a copy of your repo that lives somewhere else, like GitHub
  • origin: the usual nickname for your main remote
  • Push: upload your commits to the remote
  • Pull: download new commits from the remote

Step 1: Protect your secrets first

Before anything goes online, make sure secret files stay behind. A .gitignore file is a list of things Git should never save. Create it in your project folder:

.gitignore
# Secrets - never upload these
.env
.env.local

# Installed packages - can be re-downloaded
node_modules/

# System junk
.DS_Store

Let's break this down:

  • .env and .env.local hold your API keys. You learned about them in the secrets lessons
  • node_modules is a huge folder of downloaded code. It can be rebuilt anytime
  • Lines starting with # are comments for humans
Once a key is pushed to GitHub, treat it as leaked, even if you delete it later. Make a new key on the provider's website and delete the old one.

Commit the new file:

bash
git add .
git commit -m "Add .gitignore for secrets and node_modules"

Step 2: Connect and push

Copy the link from your new GitHub repo page. It looks like https://github.com/your-name/my-first-repo.git. Then run:

bash
git remote add origin https://github.com/your-name/my-first-repo.git
git branch -M main
git push -u origin main
  • git remote add origin ... tells Git where your GitHub copy lives
  • git branch -M main names your main branch main, which GitHub expects
  • git push -u origin main uploads your commits. The -u remembers the target, so next time you only type git push
Your computer
GitHub
git push
→
←
Who are you? (sign in)
Browser login / token
→
←
Commits saved
Your computer sends commits up, and GitHub confirms it saved them.

Step 3: Sign in

The first time you push, GitHub needs to know it's really you. Your GitHub password does not work in the terminal. Use one of these easy options:

  • Browser sign-in: on Windows and Mac, a browser window often opens. Click to approve and you're done
  • GitHub CLI: install it from cli.github.com, then run gh auth login and follow the questions
  • VS Code: use the Source Control panel and click "Publish" or "Sync". VS Code asks you to sign in with GitHub in the browser
bash
gh auth login

Refresh your GitHub repo page. You should now see your files and your commit messages.

The everyday routine

From now on, saving and backing up is three commands:

bash
git add .
git commit -m "Describe the change"
git push

If you change files on GitHub's website, or an AI builder pushes for you, download those changes with:

bash
git pull

You can also ask Claude Code to do it all:

Prompt
Check that .env and node_modules are in .gitignore.
Then commit my changes with a clear message and push to GitHub.

Troubleshooting

Common mistakes

  • Wrong: pushing before creating .gitignore. Right: add .gitignore first, then push.
  • Wrong: typing your GitHub password when the terminal asks. Right: use browser sign-in, gh auth login, or VS Code.
  • Wrong: committing but forgetting to push. Right: check GitHub to see your latest commit.

Practice

Try these exercises to lock in what you just learned.

Quiz
Not started
Your project has a .env file with an API key. What must you do before your first push?
Quiz
Not started
When you push, the terminal rejects your GitHub password. What's the easiest fix?
Quiz
Not started
What does the -u in git push -u origin main do?

What's next?

You can now save your work and back it up online. Next, let's see how AI app builders can build a whole web app from a chat, starting with the AI app builders overview.