Back to Developer Roadmap

git push --force

src/data/roadmaps/git-github/content/[email protected]

4.0855 B
Original Source

git push --force

git push --force is a command that allows you to overwrite or "force" an existing commit on a remote repository with a new commit from your local repository. This can be useful in certain situations, such as when you need to update the remote branch with changes that were previously rejected or when you want to remove commits that are no longer relevant. However, it's essential to exercise caution when using git push --force because it can overwrite changes made by others or even your own previous work. Always verify that there are no conflicting changes on the remote repository before using this command.

Visit the following resources to learn more: