Hi Alex On 02/07/2023 21:08, Alex Henrie wrote:
Many times now, I have seen novices do the following: 1. Start work on their own personal topic branch 2. Push the branch to origin 3. Rebase the branch onto origin/master 4. Try to push again, but Git says they need to pull 5. Pull and make a mess trying to reconcile the older topic branch with the rebased topic branch Help avoid this mistake by giving advice that mentions force-pushing, rather than assuming that the user always wants to do reconciliation.
I don't think we want to be advising users to force push. For the case you mention above I think it would be much safer to advise them to use
git push --force-if-includes In the absence of background fetches even git push --force-with-lease is still safer than git push --force Best Wishes Phillip
Alex Henrie (2): remote: advise about force-pushing as an alternative to reconciliation push: advise about force-pushing as an alternative to reconciliation builtin/push.c | 22 +++++++++++++--------- remote.c | 3 ++- 2 files changed, 15 insertions(+), 10 deletions(-)