diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-12-18 21:38:29 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-12-18 21:38:56 -0800 |
commit | d8a3581b55e27c071e22a540620cf8a42291af87 (patch) | |
tree | 16c29a066773f5231ddb9dab61a7998ee0a5ac19 /advice.c | |
parent | 26e94af0ba2f35438bab4a88caa4a16f5e056bac (diff) | |
download | git-jc/advise-push-default.tar.gz |
push: hint to use push.default=upstream when appropriatejc/advise-push-default
If you push into a shared repository that others push to, and you have
local branches in your repository that matches the remote side but do not
keep them up-to-date, then 'matching refs' is not an appropriate default
for you.
Detect when push failed due to non-fast-forward _and_ we did matching refs
by default (i.e. if the user explicitly said ':' from the command line, or
had push.default set to 'matching', then we do not want to advise), and
give a hint to tell the user that the user may want to set 'push.default'
configuration variable to 'upstream', if the remote repository receives
pushes from other places.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'advice.c')
-rw-r--r-- | advice.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -6,6 +6,7 @@ int advice_commit_before_merge = 1; int advice_resolve_conflict = 1; int advice_implicit_identity = 1; int advice_detached_head = 1; +int advice_push_use_upstream = 1; static struct { const char *name; @@ -17,6 +18,7 @@ static struct { { "resolveconflict", &advice_resolve_conflict }, { "implicitidentity", &advice_implicit_identity }, { "detachedhead", &advice_detached_head }, + { "pushuseupstream", &advice_push_use_upstream }, }; void advise(const char *advice, ...) |