Git · Middle · Question 63 of 75

What happens with git commit --amend on a commit that's already pushed?

Explanation

Amend creates a new commit, so the remote branch and your branch diverge. On your own PR branch that's acceptable with --force-with-lease; on main it isn't.

Further reading

Problem with a question

Git · Middle · question 63

Test yourself

Take the Git · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz