Thread (1 message) 1 message, 1 author, 2016-06-15

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

Teemu Likonen [off-list ref] writes:
On 2009-08-08 09:51 (+0200), Matthieu Moy wrote:
quoted
'git push' failing because of non-fast forward is a very common situation,
and a beginner does not necessarily understand "fast forward" immediately.
quoted
+		if (nonfastforward) {
+			printf("Push was rejected because it would not result in a fast forward:\n"
+			       "Merge in the remote changes (using git pull) before pushing yours,\n"
+			       "or use git push --force to discard the remote changes.\n"
+			       "See 'non-fast forward' section of 'git push --help' for details.\n");
+		}
I'd like to add that some projects that use Git in (partially)
centralized manner prefer "git pull --rebase" before "git push".
Right, but I don't think this error message is the place to discuss
that. Anything involving rebasing should be taken with care, and
pointing the user to it in a short sentence sounds like "try shooting
yourself in the foot, and read the man page if it hurts" ;-).

-- 
Matthieu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help