Topic 3

Clone + First Push

Clone the empty repository first, then bring the working project into that clone and make the initial push from there.

Clone the empty repository

Start by cloning the repository GitHub created for you.

git clone <repository-url>
cd <repository-folder>

Copy the repository URL from GitHub before opening any local workflow.

GitHub repository page with the clone URL copied

You can also start the clone flow directly from VS Code instead of pasting the command in the terminal.

VS Code source control panel with Clone Repository

Copy the project into the clone

Move the working files into the cloned folder instead of trying to push from an unrelated directory. This keeps the remote and local repository history aligned from the beginning.

Choose a destination folder for the clone before moving any project files.

Folder selection dialog for choosing a clone destination

After the clone finishes, open that cloned repository as the working folder before copying your project files into it.

VS Code after opening the cloned repository

First commit and push

git status
git add .
git commit -m "Initial project import"
git push origin main

If the default branch is not main, use the branch name GitHub created for the repository.

With the files inside the clone, write a clear initial commit message.

VS Code source control panel with a commit message entered

Publish the first commit with a normal push — or use the combined commit-and-push if your interface offers it.

VS Code commit menu showing Commit & Push

Before proceeding

If GitHub now shows the project files and your local repository is clean after the push, the first remote publication worked.