Skip to content

Commit 1108cdc

Browse files
committed
Changed checkout instructions to use sparse-checkout instead of normal checkout
Referred to Git documentation page on sparse-checkout as not only --cone used to not be default, but init was also not deprecated
1 parent ad721bf commit 1108cdc

1 file changed

Lines changed: 36 additions & 7 deletions

File tree

hub/package-manager/package/repository.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,16 @@ To create a fork of the Windows Package Manager Community repository and clone t
5959
2. From Windows Command Prompt or PowerShell, use the following command to clone your fork.
6060

6161
```powershell
62-
git clone <your-fork-name>
62+
git clone --no-checkout <your-fork-name>
6363
```
6464
65-
3. If you are entering multiple submissions, create a branch instead of a fork. We currently allow only one manifest file per submission.
65+
### Step 4: Setup sparse checkout
6666
67-
```powershell
68-
git checkout -b <branch-name>
69-
```
70-
71-
### Step 4: Add your manifest to the local repository
67+
Sparse checkout allows you to choose which parts of a repository you want to download, instead of downloading everything.
68+
Next you have to specify filters for sparse checkout to use (stored in `.git/info/sparse-checkout`).
7269
7370
You must add your manifest files to the repository in the following folder structure:
71+
To initialize sparse checkout for a repository you must type:
7472
7573
**manifests** / **letter** / **publisher** / **application** / **version**
7674
@@ -82,6 +80,37 @@ You must add your manifest files to the repository in the following folder struc
8280
8381
The `PackageIdentifier` and the `PackageVersion` values in the manifest must match the publisher, application names and version in the manifest folder path. For more information, see [Create your package manifest](manifest.md#tips-and-best-practices).
8482
83+
Thus to set up sparse checkout for all manifests of a publisher, you'd type:
84+
85+
1. If you are using Git version 2.37.0 or newer, run the following command to set up spare checkout for your folder.
86+
87+
```powershell
88+
git sparse-checkout set manifests\<letter>\<publisher>
89+
```
90+
91+
If you are using an older version of Git, refer to the [Git documentation](https://git-scm.com/docs/git-sparse-checkout) for how to set up sparse checkout for your local repository.
92+
93+
Note that the above command will override all current sparse checkout settings and set it up for only that one folder, refer to the [Git documentation](https://git-scm.com/docs/git-sparse-checkout) for setting up sparce checkout with multiple folders.
94+
95+
### Step 5: Checkout the repository
96+
97+
You can now apply the sparse checkout settings by running.
98+
99+
```powershell
100+
git checkout
101+
```
102+
103+
If you are entering multiple submissions, create a branch instead of a fork. We currently allow only one manifest file per submission.
104+
105+
```powershell
106+
git checkout -b <branch-name>
107+
```
108+
109+
### Step 5: Add your manifest to the local repository
110+
111+
Add your files into the folder explained in step 3.
112+
**manifests** / **letter** / **publisher** / **application** / **version**
113+
85114
### Step 5: Submit your manifest to the remote repository
86115

87116
You're now ready to push your new manifest to the remote repository.

0 commit comments

Comments
 (0)