Git Push
git push sends your local commits to a remote, so others can see them.
If the remote has commits you do not have, the push is rejected. Pull first, then push again.
Push your commits
git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
git push origin
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 16 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 363 bytes | 363.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To https://github.com/w3schools-test/hello-world.git
87cd5ca..084bcd7 main -> main
Push a new branch
A new branch needs -u the first time, to set its upstream:
git push
fatal: The current branch html-skeleton has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin html-skeleton
To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.
git push -u origin html-skeleton
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
branch 'html-skeleton' set up to track 'origin/html-skeleton'.
To https://github.com/w3schools-test/hello-world.git
* [new branch] html-skeleton -> html-skeleton