git push — Uploading Changes
git push uploads your local commits to the remote repository, making your work available to teammates. Git only sends the new commits the remote does not have yet — it is efficient and incremental.
01.How Push Works
Push does not copy your entire working directory — it sends only the new commit objects (the delta) that the remote is missing. Git compresses and transmits only what is needed. After a push, the remote-tracking branch (origin/main) in your local repo is also updated to reflect the new state.
02.Setting Upstream with -u
The -u flag (short for --set-upstream) creates a tracking link between your local branch and the remote branch. You only need this once per branch. After running "git push -u origin main", all future pushes and pulls from that branch can use just "git push" and "git pull" with no arguments.
Commands
What does the -u flag in "git push -u origin main" do?