Need Assistance?

support@tutorialshub.in

Remote Repositories and Collaboration

Pushing commits

ADVERTISEMENT
Git Free Lesson
5 min read
ADVERTISEMENT

Push publishes commits

git push sends local commits and updates a remote branch when the server allows the operation. A push does not send every file in your working directory; it sends commits and the objects they reference.

First push of a new branch

For a new local branch, git push -u origin branch-name establishes an upstream relationship. Later, a plain git push can use that relationship.

Understand rejected pushes

A push may be rejected because the remote contains commits you do not have or because branch protection rules forbid the operation. Usually integrate the remote changes rather than overwriting other developers' work.

ADVERTISEMENT