From patchwork Fri Jul 7 05:42:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Henrie X-Patchwork-Id: 13304445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3640CC0015E for ; Fri, 7 Jul 2023 05:43:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232168AbjGGFna (ORCPT ); Fri, 7 Jul 2023 01:43:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229847AbjGGFn3 (ORCPT ); Fri, 7 Jul 2023 01:43:29 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 839241FC6 for ; Thu, 6 Jul 2023 22:43:26 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-668711086f4so1043291b3a.1 for ; Thu, 06 Jul 2023 22:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688708606; x=1691300606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MhxgO4fqQlgqL3ynjcgsG/0LLib1Z+pwZcIx8EvKXjE=; b=eZGYVIGejNbZ+HMFIn1TJDpRjAkKidB4uGVCe2uq5Lv36SgucMKQLBeAtvWFmYMpnF zG4J+bufl8hLsxJKeFbiMM3dFQo15iioDTdiaVTwVgUWTNnwWcnd/JmTbwKMnwMzh8lx 3HeEOe98KjIuZchKBH8unJily9z5fRHOWD5RF61ZitzW65Y6QCUfGp6qafQuPs3s05IJ SnTp40Zj2PRTkcPoE5Q7twWQjkRXv6yAqS1CcbE0C75JIbNpmXxIBuCo4wqDR1A/dLxx q7ZnNmswnXhbBC0i0dUsKsugKZEv7YPg37M/U3DEmM9jZeIq9CXpeidfjTt8LWoOPFf3 55zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688708606; x=1691300606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MhxgO4fqQlgqL3ynjcgsG/0LLib1Z+pwZcIx8EvKXjE=; b=NpZhQ5r1JwaXPDV9pqCV+4tm5wAmUIe+18uMRByp1GJWEDkXJbWxwo2KUTrpk0doaP tGQwhzKANGs+LBMCbQvwYY/6y0fgfSTohvjkUL6NTjumf3xljnqYUO9rqlxdN/zdEkVc AKL9lx/nYhv/gkZ8FLMTr/Dds0rioOj72XMcKAgDbrhO4gJowioek5SiT+ytpx0KU10C 5Ddac3v4BE2/+LJyhjtOgmMLYpRPAenUrEoW9HOvGO5oMlNnJlQjX0+94EqB1gnFIdgR ZlehgWKI+k7L+1WgPCOoMtt2Dh9TEV4ombcxCfdVsTka1awf1Veo+O3CL+GW5J1Ma7Qi 8E5A== X-Gm-Message-State: ABy/qLZjdYg+FV7XmaOfXX5Iwmd5wg/+9dxSSh7HJQ4E5Wb16qkU7GjN 3eiUTOlRsSH/zNji2ytdvoAcWM02GMs= X-Google-Smtp-Source: APBJJlFH6pDWegKBxeMMAYxD5t+g7K0bgJfqyNvt0YNC3jTiCiH2Y/sOdVX7chsKc7JfloG2g7UwQA== X-Received: by 2002:a05:6a00:1886:b0:668:7494:384a with SMTP id x6-20020a056a00188600b006687494384amr7081042pfh.12.1688708605407; Thu, 06 Jul 2023 22:43:25 -0700 (PDT) Received: from xavier.lan ([2607:fa18:92fe:92b::2a2]) by smtp.gmail.com with ESMTPSA id r8-20020a635d08000000b00553dcfc2179sm2132568pgb.52.2023.07.06.22.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 22:43:24 -0700 (PDT) From: Alex Henrie To: git@vger.kernel.org, git@matthieu-moy.fr, christiwald@gmail.com, john@keeping.me.uk, philipoakley@iee.email, gitster@pobox.com, phillip.wood123@gmail.com, phillip.wood@dunelm.org.uk Cc: Alex Henrie Subject: [PATCH v4 1/2] remote: advise about force-pushing as an alternative to reconciliation Date: Thu, 6 Jul 2023 23:42:47 -0600 Message-ID: <20230707054257.3366355-2-alexhenrie24@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707054257.3366355-1-alexhenrie24@gmail.com> References: <20230706040111.81110-1-alexhenrie24@gmail.com> <20230707054257.3366355-1-alexhenrie24@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Also, don't imply that `git pull` is only for merging. Signed-off-by: Alex Henrie --- remote.c | 5 ++- t/t7508-status.sh | 110 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 92 insertions(+), 23 deletions(-) diff --git a/remote.c b/remote.c index a81f2e2f17..1fe86f8b23 100644 --- a/remote.c +++ b/remote.c @@ -2323,7 +2323,10 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb, base, ours, theirs); if (advice_enabled(ADVICE_STATUS_HINTS)) strbuf_addstr(sb, - _(" (use \"git pull\" to merge the remote branch into yours)\n")); + _(" (To reconcile your local changes with the work at the remote, you can\n" + " use 'git pull' and then 'git push'. To discard the work at the remote\n" + " and replace it with what you did (alone), you can use\n" + " 'git push --force'.)\n")); } free(base); return 1; diff --git a/t/t7508-status.sh b/t/t7508-status.sh index 36567708f5..2a17e84793 100755 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@ -92,7 +92,10 @@ test_expect_success 'status --column' ' # On branch main # Your branch and '\''upstream'\'' have diverged, # and have 1 and 2 different commits each, respectively. -# (use "git pull" to merge the remote branch into yours) +# (To reconcile your local changes with the work at the remote, you can +# use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote +# and replace it with what you did (alone), you can use +# '\''git push --force'\''.) # # Changes to be committed: # (use "git restore --staged ..." to unstage) @@ -123,7 +126,10 @@ cat >expect <<\EOF # On branch main # Your branch and 'upstream' have diverged, # and have 1 and 2 different commits each, respectively. -# (use "git pull" to merge the remote branch into yours) +# (To reconcile your local changes with the work at the remote, you can +# use 'git pull' and then 'git push'. To discard the work at the remote +# and replace it with what you did (alone), you can use +# 'git push --force'.) # # Changes to be committed: # (use "git restore --staged ..." to unstage) @@ -270,7 +276,10 @@ test_expect_success 'status with gitignore' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 1 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -335,7 +344,10 @@ test_expect_success 'status with gitignore (nothing untracked)' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 1 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -405,7 +417,10 @@ test_expect_success 'status -uno' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 1 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -467,7 +482,10 @@ test_expect_success 'status -unormal' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 1 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -522,7 +540,10 @@ test_expect_success 'status -uall' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 1 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -582,7 +603,10 @@ test_expect_success 'status with relative paths' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 1 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -650,7 +674,10 @@ test_expect_success TTY 'status with color.ui' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 1 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -773,7 +800,10 @@ test_expect_success 'status without relative paths' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 1 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -847,7 +877,10 @@ test_expect_success 'dry-run of partial commit excluding new file in index' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 1 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -901,7 +934,10 @@ test_expect_success 'status submodule summary is disabled by default' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 1 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -958,7 +994,10 @@ test_expect_success 'status submodule summary' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 1 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -1017,7 +1056,10 @@ test_expect_success 'status submodule summary (clean submodule): commit' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 2 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes not staged for commit: (use "git add ..." to update what will be committed) @@ -1065,7 +1107,10 @@ test_expect_success 'commit --dry-run submodule summary (--amend)' ' On branch main Your branch and '\''upstream'\'' have diverged, and have 2 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --source=HEAD^1 --staged ..." to unstage) @@ -1117,7 +1162,10 @@ test_expect_success '--ignore-submodules=untracked suppresses submodules with un On branch main Your branch and '\''upstream'\'' have diverged, and have 2 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -1226,7 +1274,10 @@ test_expect_success "--ignore-submodules=untracked doesn't suppress submodules w On branch main Your branch and '\''upstream'\'' have diverged, and have 2 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -1283,7 +1334,10 @@ test_expect_success "--ignore-submodules=untracked doesn't suppress submodule su On branch main Your branch and '\''upstream'\'' have diverged, and have 2 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -1364,7 +1418,10 @@ cat > expect << EOF ; On branch main ; Your branch and 'upstream' have diverged, ; and have 2 and 2 different commits each, respectively. -; (use "git pull" to merge the remote branch into yours) +; (To reconcile your local changes with the work at the remote, you can +; use 'git pull' and then 'git push'. To discard the work at the remote +; and replace it with what you did (alone), you can use +; 'git push --force'.) ; ; Changes to be committed: ; (use "git restore --staged ..." to unstage) @@ -1412,7 +1469,10 @@ test_expect_success "--ignore-submodules=all suppresses submodule summary" ' On branch main Your branch and '\''upstream'\'' have diverged, and have 2 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes not staged for commit: (use "git add ..." to update what will be committed) @@ -1438,7 +1498,10 @@ test_expect_success '.gitmodules ignore=all suppresses unstaged submodule summar On branch main Your branch and '\''upstream'\'' have diverged, and have 2 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) @@ -1558,7 +1621,10 @@ test_expect_success 'git commit --dry-run will show a staged but ignored submodu On branch main Your branch and '\''upstream'\'' have diverged, and have 2 and 2 different commits each, respectively. - (use "git pull" to merge the remote branch into yours) + (To reconcile your local changes with the work at the remote, you can + use '\''git pull'\'' and then '\''git push'\''. To discard the work at the remote + and replace it with what you did (alone), you can use + '\''git push --force'\''.) Changes to be committed: (use "git restore --staged ..." to unstage) From patchwork Fri Jul 7 05:42:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Henrie X-Patchwork-Id: 13304446 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8914EB64D9 for ; Fri, 7 Jul 2023 05:43:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232225AbjGGFnc (ORCPT ); Fri, 7 Jul 2023 01:43:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232149AbjGGFn3 (ORCPT ); Fri, 7 Jul 2023 01:43:29 -0400 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40EDE1BE8 for ; Thu, 6 Jul 2023 22:43:28 -0700 (PDT) Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7658430eb5dso156821285a.2 for ; Thu, 06 Jul 2023 22:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688708607; x=1691300607; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+AeJM2MW61pCLyMZ1lrX8eQ/79HFymObe4v3IQn3/QQ=; b=a9a1Gc2ZeMG4s5LmYpOmrVULqcng7kECqsZxFnF+rXLmzyXja9ioRAixSRSjxc9WCM GKNUbYhEkWaoeitxCEaZVWQNefLnpY84eML161WxF03Ww1ulKz/YO/UY8pgngrmXZdX/ KcLk0VRtSihjWV8E952pmcGxm18RJXJqyCFyUfbad506xKkb7rX/YYfHkzVq+dCsVAGN Iu/ULor9fOfRSRyiPngDeXAWX0tEFfQsbAyqWkITXmWr0wyIctyBFBmxBQf8PteS77mH tKUIXe7enODwXF2RyTOdkqYVUm7IuQeVYQZnUhl//IIiqFx78pALFzakopvrZh39GiVi ywhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688708607; x=1691300607; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+AeJM2MW61pCLyMZ1lrX8eQ/79HFymObe4v3IQn3/QQ=; b=kTdbVYM41BqxkbKiTOoduZ8sDwsUZW/4cnsqvlaub90prv+jVXd2YFPuXC7W/D5ojp FzyQ7PalWAV4SJ3tmXff05VxRUagz74e4S2+00gwcriMGMeR3sSy6+IhN2yYao+csuvs 6+aVMf7g8FzHapl3Xxqr/poUWu26eqSCaQxqnwbx97OEGSElhqkzKiAUGVNnNgjN8V96 6iB2qphYy+03x0ZbRdyIXyKs3DDCyGRKTI5ZHOAFCs7RhPgl1r39wbIATC/+Rk1TzZoC LT38aBXWNO8HIt86sqlJuqrN1NSvmIIOchjXKdRzKbRbbB7XgZRbPWN3RrrNErZZd4ub 9wEA== X-Gm-Message-State: ABy/qLaAZeZX6ILXheN3kHl0VUW1omG/5Nk0JQEty4Xqd/Ijizjj0MH7 VAAyJCyUo2sSEYjC17e16Nq1a3Jambg= X-Google-Smtp-Source: APBJJlGG5icrT7xueCm5yITfeeLn7647HLf6vFWqyetfsxzSHrtfb75pzs5e9ap66tXQVkrraKUdZA== X-Received: by 2002:a05:620a:c4c:b0:767:6854:e92d with SMTP id u12-20020a05620a0c4c00b007676854e92dmr5238291qki.44.1688708607012; Thu, 06 Jul 2023 22:43:27 -0700 (PDT) Received: from xavier.lan ([2607:fa18:92fe:92b::2a2]) by smtp.gmail.com with ESMTPSA id r8-20020a635d08000000b00553dcfc2179sm2132568pgb.52.2023.07.06.22.43.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 22:43:26 -0700 (PDT) From: Alex Henrie To: git@vger.kernel.org, git@matthieu-moy.fr, christiwald@gmail.com, john@keeping.me.uk, philipoakley@iee.email, gitster@pobox.com, phillip.wood123@gmail.com, phillip.wood@dunelm.org.uk Cc: Alex Henrie Subject: [PATCH v4 2/2] push: advise about force-pushing as an alternative to reconciliation Date: Thu, 6 Jul 2023 23:42:48 -0600 Message-ID: <20230707054257.3366355-3-alexhenrie24@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707054257.3366355-1-alexhenrie24@gmail.com> References: <20230706040111.81110-1-alexhenrie24@gmail.com> <20230707054257.3366355-1-alexhenrie24@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Also, don't put `git pull` in an awkward parenthetical, because `git pull` can always be used to reconcile branches and is the normal way to do so. Signed-off-by: Alex Henrie --- builtin/push.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/builtin/push.c b/builtin/push.c index 6f8a8dc711..b2f0a64e7c 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -301,21 +301,24 @@ static void setup_default_push_refspecs(int *flags, struct remote *remote) static const char message_advice_pull_before_push[] = N_("Updates were rejected because the tip of your current branch is behind\n" - "its remote counterpart. Integrate the remote changes (e.g.\n" - "'git pull ...') before pushing again.\n" + "its remote counterpart. Use 'git pull' to integrate the remote changes\n" + "before pushing again, or use 'git push --force' to delete the remote\n" + "changes and replace them with your own.\n" "See the 'Note about fast-forwards' in 'git push --help' for details."); static const char message_advice_checkout_pull_push[] = N_("Updates were rejected because a pushed branch tip is behind its remote\n" - "counterpart. Check out this branch and integrate the remote changes\n" - "(e.g. 'git pull ...') before pushing again.\n" + "counterpart. Check out this branch and use 'git pull' to integrate the\n" + "remote changes before pushing again, or use 'git push --force' to delete\n" + "the remote changes and replace them with your own.\n" "See the 'Note about fast-forwards' in 'git push --help' for details."); static const char message_advice_ref_fetch_first[] = - N_("Updates were rejected because the remote contains work that you do\n" - "not have locally. This is usually caused by another repository pushing\n" - "to the same ref. You may want to first integrate the remote changes\n" - "(e.g., 'git pull ...') before pushing again.\n" + N_("Updates were rejected because the remote contains work that you do not\n" + "have locally. This is usually caused by another repository pushing to\n" + "the same ref. Use 'git pull' to integrate the remote changes before\n" + "pushing again, or use 'git push --force' to delete the remote changes\n" + "and replace them with your own.\n" "See the 'Note about fast-forwards' in 'git push --help' for details."); static const char message_advice_ref_already_exists[] = @@ -327,10 +330,10 @@ static const char message_advice_ref_needs_force[] = "without using the '--force' option.\n"); static const char message_advice_ref_needs_update[] = - N_("Updates were rejected because the tip of the remote-tracking\n" - "branch has been updated since the last checkout. You may want\n" - "to integrate those changes locally (e.g., 'git pull ...')\n" - "before forcing an update.\n"); + N_("Updates were rejected because the tip of the remote-tracking branch has\n" + "been updated since the last checkout. Use 'git pull' to integrate the\n" + "remote changes before pushing again, or use 'git push --force' to delete\n" + "the remote changes and replace them with your own.\n"); static void advise_pull_before_push(void) {