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.
You can also start the clone flow directly from VS Code instead of pasting the command in the terminal.
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.
After the clone finishes, open that cloned repository as the working folder before copying your project files into it.
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.
Publish the first commit with a normal push — or use the combined commit-and-push if your interface offers it.
Before proceeding
If GitHub now shows the project files and your local repository is clean after the push, the first remote publication worked.