git push -u <remote> <branchname>
Push commits to a remote repository
This command pushes the commits in the current branch to the specified remote repository. The -u
flag sets the upstream branch for the current branch, tracking it for future git pull
commands. The <remote>
parameter specifies the remote repository to push to, and the <branchname>
parameter specifies the branch to push.
Optionally, you can use the --set-upstream
flag as a long version of -u
.
Specific examples:
git push -u origin main