File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -142,8 +142,9 @@ advice.*::
142
142
--
143
143
pushUpdateRejected::
144
144
Set this variable to 'false' if you want to disable
145
- 'pushNonFFCurrent', 'pushNonFFDefault', and
146
- 'pushNonFFMatching' simultaneously.
145
+ 'pushNonFFCurrent', 'pushNonFFDefault',
146
+ 'pushNonFFMatching', and 'pushAlreadyExists'
147
+ simultaneously.
147
148
pushNonFFCurrent::
148
149
Advice shown when linkgit:git-push[1] fails due to a
149
150
non-fast-forward update to the current branch.
@@ -158,6 +159,9 @@ advice.*::
158
159
'matching refs' explicitly (i.e. you used ':', or
159
160
specified a refspec that isn't your current branch) and
160
161
it resulted in a non-fast-forward error.
162
+ pushAlreadyExists::
163
+ Shown when linkgit:git-push[1] rejects an update that
164
+ does not qualify for fast-forwarding (e.g., a tag.)
161
165
statusHints::
162
166
Show directions on how to proceed from the current
163
167
state in the output of linkgit:git-status[1] and in
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ int advice_push_update_rejected = 1;
4
4
int advice_push_non_ff_current = 1 ;
5
5
int advice_push_non_ff_default = 1 ;
6
6
int advice_push_non_ff_matching = 1 ;
7
+ int advice_push_already_exists = 1 ;
7
8
int advice_status_hints = 1 ;
8
9
int advice_commit_before_merge = 1 ;
9
10
int advice_resolve_conflict = 1 ;
@@ -18,6 +19,7 @@ static struct {
18
19
{ "pushnonffcurrent" , & advice_push_non_ff_current },
19
20
{ "pushnonffdefault" , & advice_push_non_ff_default },
20
21
{ "pushnonffmatching" , & advice_push_non_ff_matching },
22
+ { "pushalreadyexists" , & advice_push_already_exists },
21
23
{ "statushints" , & advice_status_hints },
22
24
{ "commitbeforemerge" , & advice_commit_before_merge },
23
25
{ "resolveconflict" , & advice_resolve_conflict },
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ extern int advice_push_update_rejected;
7
7
extern int advice_push_non_ff_current ;
8
8
extern int advice_push_non_ff_default ;
9
9
extern int advice_push_non_ff_matching ;
10
+ extern int advice_push_already_exists ;
10
11
extern int advice_status_hints ;
11
12
extern int advice_commit_before_merge ;
12
13
extern int advice_resolve_conflict ;
Original file line number Diff line number Diff line change @@ -247,6 +247,8 @@ static void advise_checkout_pull_push(void)
247
247
248
248
static void advise_ref_already_exists (void )
249
249
{
250
+ if (!advice_push_already_exists || !advice_push_update_rejected )
251
+ return ;
250
252
advise (_ (message_advice_ref_already_exists ));
251
253
}
252
254
You can’t perform that action at this time.
0 commit comments