π Homepage
β¬ οΈ Previous: π Setting up SSH Keys
git remote add origin git@github.com:username/repo.git
β‘οΈ This command connects your local repository to a remote GitHub repository named origin
.
π Replace the URL with your actual repository URL.
Once youβve made your first commit locally, you need to connect your local repository to a remote repository (like GitHub) and push the code.
Use the -u flag with git push to set the upstream branch:
git push -u origin main
git push
β the command to upload your commits.
-u
tells Git to remember the remote branch (origin/main
), so you can just use git push
or git pull
in the future.
origin
β the name of the remote (you can rename or have multiple remotes).
main
β the branch youβre pushing.
β Now your local project is connected and pushed to GitHub!
β‘οΈUp Next:π Summary