File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -142,8 +142,9 @@ advice.*::
142142--
143143 pushUpdateRejected::
144144 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.
147148 pushNonFFCurrent::
148149 Advice shown when linkgit:git-push[1] fails due to a
149150 non-fast-forward update to the current branch.
@@ -158,6 +159,9 @@ advice.*::
158159 'matching refs' explicitly (i.e. you used ':', or
159160 specified a refspec that isn't your current branch) and
160161 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.)
161165 statusHints::
162166 Show directions on how to proceed from the current
163167 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;
44int advice_push_non_ff_current = 1 ;
55int advice_push_non_ff_default = 1 ;
66int advice_push_non_ff_matching = 1 ;
7+ int advice_push_already_exists = 1 ;
78int advice_status_hints = 1 ;
89int advice_commit_before_merge = 1 ;
910int advice_resolve_conflict = 1 ;
@@ -18,6 +19,7 @@ static struct {
1819 { "pushnonffcurrent" , & advice_push_non_ff_current },
1920 { "pushnonffdefault" , & advice_push_non_ff_default },
2021 { "pushnonffmatching" , & advice_push_non_ff_matching },
22+ { "pushalreadyexists" , & advice_push_already_exists },
2123 { "statushints" , & advice_status_hints },
2224 { "commitbeforemerge" , & advice_commit_before_merge },
2325 { "resolveconflict" , & advice_resolve_conflict },
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ extern int advice_push_update_rejected;
77extern int advice_push_non_ff_current ;
88extern int advice_push_non_ff_default ;
99extern int advice_push_non_ff_matching ;
10+ extern int advice_push_already_exists ;
1011extern int advice_status_hints ;
1112extern int advice_commit_before_merge ;
1213extern 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)
247247
248248static void advise_ref_already_exists (void )
249249{
250+ if (!advice_push_already_exists || !advice_push_update_rejected )
251+ return ;
250252 advise (_ (message_advice_ref_already_exists ));
251253}
252254
You can’t perform that action at this time.
0 commit comments