Skip to content

Commit bd002f2

Browse files
committed
Merge branch 'feature/tag-option'.
2 parents 788fe26 + a7718b5 commit bd002f2

File tree

7 files changed

+544
-254
lines changed

7 files changed

+544
-254
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ OPTIONS:
4646
-s | --subdir Subfolder to be cloned.
4747
4848
-t | --token Path to your access token (for private repos).
49-
-u | --user Your username (for private repos).
5049
5150
-b | --branch Branch to be fetched.
51+
-v | --tag Tag of the version to be fetched.
5252
-d | --depth Number of commits to be fetched.
5353
```
5454

@@ -71,12 +71,10 @@ You will need to generate an access token in order to clone private repositories
7171
- Github: [github.com/settings/tokens](https://github.com/settings/tokens).
7272
- Gitlab: [gitlab.com/-/profile/personal_access_tokens](https://gitlab.com/-/profile/personal_access_tokens).
7373

74-
Save your token in a file and provide its path with the `--token` option, then provide your username with the `--user` option.
75-
76-
The following example would clone a subfolder of a private repository.
74+
Save your token in a file and provide its path with the `--token` option, the following example would clone a subfolder of a private repository.
7775
```zsh
7876
git-partial-clone --owner=owner --repo=repo --subdir=path/to/subdir \
79-
--token=/path/to/your/token/file --user=username_with_access
77+
--token=/path/to/your/token/file
8078
```
8179

8280
# Using a configuration file
@@ -105,13 +103,16 @@ Fill in the config file ([`template.conf`](./template.conf)) with the informatio
105103
### Variables for **private repositories**
106104
- `TOKEN_PATH`:
107105
- Path to the file containing the access token.
108-
- `GIT_USER`:
109-
- Username with access to the repository.
110106

111107
### Optional variables
112108
- `BRANCH`:
113109
- The branch to be fetched.
114110
- Omit it to pull all of the branches and switch to the default one.
111+
- Overrided by `TAG_NAME`.
112+
- `TAG_NAME`:(tag | t)
113+
- Tag of the version to be fetched.
114+
- Omit it to fetch the latest commit of `BRANCH`.
115+
- Takes precedence over `BRANCH`.
115116
- `COMMIT_DEPTH`:
116117
- Number of commits you want to fetch (useful for deployment purposes).
117118
- Omit it to fetch the entire remote history.

completion-rules.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ _git-partial-clone()
4040
return
4141
;;
4242
--owner | -o | --repo | -r | --subdir | -s | \
43-
--user | -u | --branch | -b | --depth | -d )
43+
--branch | -b | --depth | -d | \
44+
--tag | -v)
4445
# Suggest nothing :P
4546
return
4647
;;
48+
--tag | -v)
49+
return
50+
;;
4751
--help*)
4852
return
4953
;;

example.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ REPO_NAME=vscode-settings
1313
REMOTE_PARTIAL_DIR=json/snippets
1414

1515
TOKEN_PATH=
16-
GIT_USER=
1716

1817
BRANCH=master
18+
TAG_NAME=
1919
COMMIT_DEPTH=3
2020

2121
PARENT_DIR=tmp

0 commit comments

Comments
 (0)