-
Notifications
You must be signed in to change notification settings - Fork 1
User: Introduce to git options
Both sub-command git-p
(git-b
) and repo
(repo-mirror
) shared some of the same options from git. It's good here to explain the usage of the options as the only references.
With the option --help
, the options mainly belong to two option groups: Remote options and Import options. Below options are from krep
with v0.3
. Other options in the groups have been removed.
Remote options:
-r REF, --refs=REF the reference prefix of the remote server
--branch-refs=HEAD_REF, --head-refs=HEAD_REF
the reference prefix of the heads. it will override
the one of "refs"
--tag-refs=TAG_REF the reference prefix of the tags. it will override the
one of "refs"
--remote=REMOTE, --server=REMOTE, --gerrit-server=REMOTE
Set gerrit url for the repository management
Import options:
-k, --keep-name keep current head or tag name without new refs as the
last part
-a, --all Take all operations except to suppress with opposite
option like "--no-tags". The action is merged by the
sub-command
--branches, --heads
push all branches to the remote. Once option "--all"
is set, it is enabled except "--no-branches" or "--no-
heads" is set explicitly
--tags push all tags to the remote. Once option "--all" is
set, it is enabled except "--no-tags" is set
explicitly
--branch-pattern=HEAD_PATTERN, --head-pattern=HEAD_PATTERN
push the matched heads with regex patterns. The
replacement rules could be used to update the remote
head name
--tag-pattern=TAG_PATTERN
push the matched tags with regex patterns. The
replacement rule could be used to update the remote
tag names
The options can be categorized into two purposes:
- Importing behaviours like how to import
- Importing naming like what to import
Thus, it can be easily to understand how to use the options:
-
remote
It's the option to indicate the remote name like ssh://cadappl@github.com and similar alternative, which can be customized in user.gitconfig
file. The option will be used by bothGerrit
andgit_cmd
. -
keep-name
It's the one to handle the pushinghead
andtag
, which prevents to cut the name to leave the last segment. The original full name will be used for push. For example,aosp/android-8.0.1_r1
will be kept if option is provide, otherwiseandroid-8.0.1_r1
will be pushed instead. -
refs
It will be treated as the prefix to insert before the pushinghead
andtag
as it's useful in some case not to break local SCM policy to leave the defaultmaster
branch. -
head-refs
It's the option likerefs
, which would override the settings ofrefs
if existed. Generally, it's good useaosp
as therefs
for Andorid Open Source Project (AOSP). -
tag-refs
It's the option likerefs
, which would override the settings ofrefs
if existed. For AOSP, it's better not to usetag-refs
to use its original manifest. -
all
The option decides which to push. With the option, bothhead
s andtag
s would be push the remote. If the option provided, optionheads
andtags
will have no effect any more except--no-heads
or--no-tags
is used to suppress the behaviour explicitly. -
heads
The option decides to pushhead
but can be overrided byall
.--no-heads
would be used to suppress the behaviour. -
tags
The option decides to pushtag
but can also be overrided byall
.--no-tags
could be used to suppress the behaviour. -
head-pattern
The option supports the pattern to match the existent local heads for push. If dismissed, allhead
s will be pushed. -
tag-pattern
The option supports the pattern to match the existent local tags for push. If dismissed, alltag
s will be pushed.