What does git push --force do?
a) Forces the remote repository to accept changes, overwriting conflicts
b) Deletes the remote branch
c) Merges a remote branch with the local branch
d) Pushes tags to the remote repository
Answer:
a) Forces the remote repository to accept changes, overwriting conflicts
Explanation:
The git push --force command forces the remote repository to accept your changes, even if it would overwrite commits on the remote branch. This is often used after rebasing or resetting a branch locally.
For example, after using git reset to modify the commit history, you may need to use git push --force to push those changes to the remote repository, overwriting the previous history.
Be cautious when using --force as it can overwrite others’ work on shared branches.