Amended Force Push
Amended force push is a combination of commit and force push it will update the last commit and it will force push it to the remote repository.
Following are the steps to perform Amended Force Push:
Step 1: Commit changes.
Commit the changes that you have done to the local repository by using amend option it will amend the most commit.
git commit --amend -m "New commit message"
Step 2: Force-push the amended commit.
Know Force pushes the local repository to the remote repository to make it available for others by using the following command.
git push --force-with-lease <Alias name> <Branch name>
using “–force-with-lease” will force push only if the remote branch’s current commit matches the expected commit. It will prevent accidental overwriting of others’ changes.
What is Git Push?
Pre-requisite: Git
Using the git push command, you can upload your files available on your local machine to the remote repository. After git pushes the changes to the remote repository other developers can access the changes and they can contribute their changes by git pulling. Before pushing it to the remote repository you need to do a git commit to your local machine.