DELAPARRA
Index
Color
NL
Category: Git commands

git push

Explained by Updated

What is git push?

git push: Upload local commits to the remote repository. git push uploads your local commits to the remote repository, so others can see them and CI can run. git push -u origin feature/export pushes a new branch and sets it as the upstream for later pushes. If someone else pushed to the same branch in the meantime, Git rejects your push. Pull or fetch and rebase first, then push again.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about git push

What should you keep in mind with git push?

Avoid git push --force on shared branches, because it overwrites other people's commits. When you really need to rewrite a branch you pushed earlier, for example after rebasing your own feature branch, use --force-with-lease. It refuses to overwrite if the remote changed since you last fetched. Protect important branches like main on GitHub or GitLab so force pushes are not possible there at all.

At a glance

CategoryGit commands
Explained by
Updated

More Git commands terms

All terms starting with G

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.