]> git.ipfire.org Git - thirdparty/git.git/commit
push: introduce '--branches' option
authorTeng Long <dyroneteng@gmail.com>
Sat, 6 May 2023 11:34:08 +0000 (19:34 +0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 6 May 2023 21:36:43 +0000 (14:36 -0700)
commit425b4d7f47bd2be561ced14eac36056390862e8c
tree21399bd405b812faeabff214cd32d862b82a0b6c
parent69c786637d7a7fe3b2b8f7d989af095f5f49c3a8
push: introduce '--branches' option

The '--all' option of git-push built-in cmd support to push all branches
(refs under refs/heads) to remote. Under the usage, a user can easlily
work in some scenarios, for example, branches synchronization and batch
upload.

The '--all' was introduced for a long time, meanwhile, git supports to
customize the storage location under "refs/". when a new git user see
the usage like, 'git push origin --all', we might feel like we're
pushing _all_ the refs instead of just branches without looking at the
documents until we found the related description of it or '--mirror'.

To ensure compatibility, we cannot rename '--all' to another name
directly, one way is, we can try to add a new option '--heads' which be
identical with the functionality of '--all' to let the user understand
the meaning of representation more clearly. Actually, We've more or less
named options this way already, for example, in 'git-show-ref' and 'git
ls-remote'.

At the same time, we fix a related issue about the wrong help
information of '--all' option in code and add some test cases in
t5523, t5543 and t5583.

Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-push.txt
builtin/push.c
t/t5523-push-upstream.sh
t/t5543-atomic-push.sh
t/t5583-push-branches.sh [new file with mode: 0755]