diff mbox series

Give example of error message when pushing to a branch with other changes

Message ID alpine.DEB.2.21.2001142345570.25401@digraph.polyomino.org.uk
State New
Headers show
Series Give example of error message when pushing to a branch with other changes | expand

Commit Message

Joseph Myers Jan. 14, 2020, 11:47 p.m. UTC
Giving explicit example of git messages seems helpful for novice users
to understand when they are in a particular situation for which
instructions are given.

Committed.
diff mbox series

Patch

diff --git a/htdocs/gitwrite.html b/htdocs/gitwrite.html
index f420fe22..e55cfa92 100644
--- a/htdocs/gitwrite.html
+++ b/htdocs/gitwrite.html
@@ -279,7 +279,19 @@  A message will be sent to the gcc-cvs mailing list indicating that a
 change was made.  If <code>git push</code> gives an error because
 someone else has pushed their own changes to the same branch,
 do <code>git pull --rebase</code> before trying <code>git push</code>
-again.</li>
+again.  A typical error in this situation looks like:
+
+<blockquote><pre>
+To git+ssh://gcc.gnu.org/git/gcc.git
+ ! [rejected]                master -> master (fetch first)
+error: failed to push some refs to 'git+ssh://gcc.gnu.org/git/gcc.git'
+hint: Updates were rejected because the remote contains work that you do
+hint: not have locally. This is usually caused by another repository pushing
+hint: to the same ref. You may want to first integrate the remote changes
+hint: (e.g., 'git pull ...') before pushing again.
+hint: See the 'Note about fast-forwards' in 'git push --help' for details.
+</pre></blockquote>
+</li>
 </ol>
 
 <hr />