Re: [PATCH 0/2] advise about force-pushing as an alternative to reconciliation
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jul 3, 2023, 15:33 UTC
- Message-ID
- <c3c36f93-3fc5-7f7d-1c24-e6925729cc96@gmail.com>
- In-Reply-To
- <20230702200818.1038494-1-alexhenrie24@gmail.com>
Hi Alex
On 02/07/2023 21:08, Alex Henrie wrote:
Show 11 quoted lines
> 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
Show 8 quoted lines
> 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(-) >