Re: [PATCH v2] push: point to 'git pull' and 'git push --force' in case of non-fast forward
From: Matthieu Moy <hidden>
Date: 2016-06-15 22:47:12
Junio C Hamano [off-list ref] writes:
Instead of saying "Merge in", we could say "Integrate" to cover both practices.
I'm fine with both. I consider rebasing as a kind of merging, but ...
I also happen to think that the mention of --force falls into the same category as "try shooting and then study if it hurgs".
Depending on the context. In the case of git push git commit --amend git push Pointing the user to 'git pull' is probably the thing which hurts the most. And to me, the name --force already means "yes, I know what I'm doing". My proposal was "[...] use git push --force to discard the remote changes." which warns enough about the danger.
So how about phrasing it like this?
Non-fast forward pushes were rejected because you would discard remote
changes you have not seen. Integrate them with your changes and then
push again. See 'non-fast forward' section of 'git push --help'.I thing not pointing to 'git pull' in the message really defeats the purpose of the patch. I don't find an error message only telling me "go read the doc as you should have done from the beginning" really helps. -- Matthieu