git-nested 1.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: git-nested
|
|
3
|
+
Version: 1.0.3
|
|
4
|
+
Summary: Git Submodule Alternative
|
|
5
|
+
Author-email: Thorsten Klein <thorsten.klein.git@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/thorsten-klein/git-nested
|
|
8
|
+
Project-URL: Documentation, https://github.com/thorsten-klein/git-nested#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/thorsten-klein/git-nested
|
|
10
|
+
Project-URL: Issues, https://github.com/thorsten-klein/git-nested/issues
|
|
11
|
+
Keywords: git,nested,submodule,nested
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: PyYAML>=6.0
|
|
25
|
+
Dynamic: license-file
|
|
26
|
+
|
|
27
|
+
# git-nested
|
|
28
|
+
|
|
29
|
+
> An alternative to git-submodule and git-subtree for managing nested repositories.
|
|
30
|
+
|
|
31
|
+
[](https://opensource.org/licenses/MIT)
|
|
32
|
+
[](https://www.python.org/downloads/)
|
|
33
|
+
|
|
34
|
+
## Overview
|
|
35
|
+
|
|
36
|
+
**git-nested** lets you set up a monorepo from multiple repositories.
|
|
37
|
+
Each git repository is placed as a copy in a subdirectory of your project.
|
|
38
|
+
But it's not just a copy—you can pull upstream changes and push local modifications with simple, intuitive commands that keep your git history clean.
|
|
39
|
+
|
|
40
|
+
### How it Works
|
|
41
|
+
|
|
42
|
+
git-nested copies source code from external repositories into your project, but it's more than a simple copy.
|
|
43
|
+
It uses git operations and a `.gitnested` metadata file to track the relationship with the upstream repository.
|
|
44
|
+
This allows you to run subsequent commands (pull, push, etc.) on the copied code as if you're working with the original repository directly.
|
|
45
|
+
|
|
46
|
+
### Why git-nested?
|
|
47
|
+
|
|
48
|
+
- **Self-contained**: Your repository becomes a monorepo. No need for additional access rights to nested repositories.
|
|
49
|
+
- **Simple**: Intuitive commands that feel like native git
|
|
50
|
+
- **Clean**: Keeps your git history squeaky clean (single commit per operation)
|
|
51
|
+
- **Just Works**: Users get everything with a normal `git clone` - no special setup needed
|
|
52
|
+
- **Flexible**: Different branches can have different nested repos in different states
|
|
53
|
+
- **Safe**: Easy to try and reset without breaking anything
|
|
54
|
+
|
|
55
|
+
### Nested-in-Nested Support
|
|
56
|
+
|
|
57
|
+
git-nested now supports nested repositories within nested repositories (recursive nesting) through `.gitnested.levelN` files:
|
|
58
|
+
|
|
59
|
+
- When you clone a nested repository that itself contains nested repositories, git-nested automatically creates `.gitnested.level2`, `.gitnested.level3`, etc. files
|
|
60
|
+
- These level files allow you to pull/push sub-nested repositories directly from the parent repository
|
|
61
|
+
- The nesting level is automatically detected based on existing level files in the repository
|
|
62
|
+
- Example: `parent/nested1/nested2` can be pulled directly with `git nested pull nested1/nested2` using its `.gitnested.level2` file
|
|
63
|
+
|
|
64
|
+
### Limitations
|
|
65
|
+
|
|
66
|
+
- git-nested squashes the commits during a `git nested pull` into one commit. Otherwise the tool cannot determine at a later point of time, that the commit was pulled or not. This feature might be added in future, so that the commit message is adapted to indicate that a commit has been pulled via git-nested.
|
|
67
|
+
|
|
68
|
+
## Quick Start
|
|
69
|
+
|
|
70
|
+
### Requirements
|
|
71
|
+
|
|
72
|
+
- Git >= 2.23
|
|
73
|
+
- Python >= 3.9 (for Python-based installation)
|
|
74
|
+
|
|
75
|
+
### Installation
|
|
76
|
+
|
|
77
|
+
#### Method 1: Via pip (Recommended)
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pip install git+https://github.com/thorsten-klein/git-nested
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Method 2: From Source with Shell Integration
|
|
84
|
+
|
|
85
|
+
Adds git-nested to PATH and enables tab completion:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
git clone https://github.com/thorsten-klein/git-nested /path/to/git-nested
|
|
89
|
+
echo 'source /path/to/git-nested/.rc' >> ~/.bashrc
|
|
90
|
+
source ~/.bashrc
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### Method 3: From Source (Manual)
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
git clone https://github.com/thorsten-klein/git-nested /path/to/git-nested
|
|
97
|
+
export PATH="/path/to/git-nested/lib:$PATH"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
> **Note:** Add the export command to your shell profile (~/.bashrc, ~/.zshrc) to make it permanent.
|
|
101
|
+
|
|
102
|
+
### Usage
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Clone a nested repository
|
|
106
|
+
git nested clone https://github.com/user/nested path/to/nested
|
|
107
|
+
|
|
108
|
+
# Pull updates from upstream
|
|
109
|
+
git nested pull path/to/nested
|
|
110
|
+
|
|
111
|
+
# Push local changes upstream
|
|
112
|
+
git nested push path/to/nested
|
|
113
|
+
|
|
114
|
+
# Check status of all nested repos
|
|
115
|
+
git nested status
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Commands
|
|
119
|
+
|
|
120
|
+
#### `git nested help`
|
|
121
|
+
|
|
122
|
+
Show help documentation.
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
git nested --help
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### `git nested clone`
|
|
129
|
+
|
|
130
|
+
Clone an external repository into a subdirectory of your project.
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
git nested clone --help
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Example:**
|
|
137
|
+
```bash
|
|
138
|
+
git nested clone https://github.com/user/lib ext/lib -b main
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### `git nested init`
|
|
142
|
+
|
|
143
|
+
Turn an existing subdirectory into a nested repository.
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
git nested init --help
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Example:**
|
|
150
|
+
```bash
|
|
151
|
+
git nested init ext/mylib -r https://github.com/user/mylib
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### `git nested pull`
|
|
155
|
+
|
|
156
|
+
Update a nested repo with the latest upstream changes.
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
git nested pull --help
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Example:**
|
|
163
|
+
```bash
|
|
164
|
+
git nested pull ext/lib
|
|
165
|
+
git nested pull --all # Pull all nested repos
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
#### `git nested push`
|
|
169
|
+
|
|
170
|
+
Push local changes back to the upstream repository.
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
git nested push --help
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Example:**
|
|
177
|
+
```bash
|
|
178
|
+
git nested push ext/lib
|
|
179
|
+
git nested push --all # Push all nested repos
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
#### `git nested status`
|
|
183
|
+
|
|
184
|
+
Show the status of nested repositories.
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
git nested status --help
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
#### `git nested fetch`
|
|
191
|
+
|
|
192
|
+
Fetch remote content for a nested repository.
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
git nested fetch --help
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
#### `git nested branch`
|
|
199
|
+
|
|
200
|
+
Create a branch with local nested commits for manual conflict resolution.
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
git nested branch --help
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
#### `git nested commit`
|
|
207
|
+
|
|
208
|
+
Add a nested branch to current history as a single commit.
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
git nested commit --help
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
#### `git nested clean`
|
|
215
|
+
|
|
216
|
+
Remove temporary branches, refs, and remotes created during nested operations.
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
git nested clean --help
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
#### `git nested config`
|
|
223
|
+
|
|
224
|
+
Read or update the configuration of a nested repository.
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
git nested config --help
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Example:**
|
|
231
|
+
```bash
|
|
232
|
+
git nested config ext/lib method rebase
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
#### `git nested version`
|
|
236
|
+
|
|
237
|
+
Display version information.
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
git nested version
|
|
241
|
+
git nested --version
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Why git-nested is Better
|
|
245
|
+
|
|
246
|
+
### Comparison with git-submodule
|
|
247
|
+
|
|
248
|
+
| git-submodule | git-nested |
|
|
249
|
+
|---------------|------------|
|
|
250
|
+
| Users must manually initialize submodules | Users get everything with `git clone` |
|
|
251
|
+
| Pulling doesn't update submodules automatically | No special commands needed |
|
|
252
|
+
| Breaks if remote repo disappears | Everything in your repo history |
|
|
253
|
+
| Removing/renaming requires many manual steps | Different branches automatically have correct nested state |
|
|
254
|
+
| Dependency on external repositories | Moving/renaming remotes doesn't break your repo |
|
|
255
|
+
|
|
256
|
+
### Comparison with git-subtree
|
|
257
|
+
|
|
258
|
+
| git-subtree | git-nested |
|
|
259
|
+
|-------------|------------|
|
|
260
|
+
| Must remember remote URL for every command | Remote/branch saved in `.gitnested` file |
|
|
261
|
+
| Verbose command syntax | Clean, intuitive commands |
|
|
262
|
+
| Collaborators aren't aware of subtrees | `.gitnested` file clearly indicates nested repos |
|
|
263
|
+
| Creates messy history with merge commits | Clean history with single commits |
|
|
264
|
+
| No state file to track remote/branch | Metadata file tracks all necessary information |
|
|
265
|
+
| Becomes slow with many commits | Optimized performance |
|
|
266
|
+
|
|
267
|
+
### Key Benefits
|
|
268
|
+
|
|
269
|
+
#### For Users
|
|
270
|
+
- Get everything with one `git clone`
|
|
271
|
+
- No need to install git-nested
|
|
272
|
+
- No special commands or knowledge required
|
|
273
|
+
- Works with normal git workflow
|
|
274
|
+
|
|
275
|
+
#### For Collaborators
|
|
276
|
+
- Only install git-nested if you need to push/pull nested repos
|
|
277
|
+
- No access to upstream nested repositories required
|
|
278
|
+
- Simple, intuitive commands for contributing changes upstream
|
|
279
|
+
- Tab completion support
|
|
280
|
+
|
|
281
|
+
#### For Maintainers
|
|
282
|
+
- Create a self-contained repository
|
|
283
|
+
- Make atomic changes across multiple nested repositories
|
|
284
|
+
- No configuration required
|
|
285
|
+
|
|
286
|
+
## Working with Nested Repos
|
|
287
|
+
|
|
288
|
+
### The `.gitnested` File
|
|
289
|
+
|
|
290
|
+
Each nested repository has a `.gitnested` metadata file that tracks its relationship with upstream:
|
|
291
|
+
|
|
292
|
+
```ini
|
|
293
|
+
[nested]
|
|
294
|
+
filter: list # Clone filter (e.g., blob:none, tree:0)
|
|
295
|
+
remote: https://github.com/user/repo # Upstream repository URL
|
|
296
|
+
branch: main # Tracked branch
|
|
297
|
+
commit: abc123... # Current commit from upstream
|
|
298
|
+
parent: def456... # Parent commit in main repo
|
|
299
|
+
method: merge # Integration method (merge/rebase)
|
|
300
|
+
cmdver: 1.0.0 # git-nested version used
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
This file:
|
|
304
|
+
- Is committed to your parent repository
|
|
305
|
+
- Is **not** pushed to the nested repository's upstream
|
|
306
|
+
- Tracks the upstream location and current state
|
|
307
|
+
- Enables seamless pull/push operations
|
|
308
|
+
|
|
309
|
+
### Conflict Resolution
|
|
310
|
+
|
|
311
|
+
If a pull or push operation encounters merge conflicts, git-nested will guide you through manual resolution:
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
git nested fetch <subdir> # Fetch the latest changes
|
|
315
|
+
git nested branch <subdir> # Create a branch for manual resolution
|
|
316
|
+
# Resolve conflicts manually in your editor
|
|
317
|
+
git nested commit <subdir> # Commit the resolved changes
|
|
318
|
+
git nested clean <subdir> # Clean up temporary branches
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Development
|
|
322
|
+
|
|
323
|
+
### Setting Up Development Environment
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
# Install dependencies with uv (recommended)
|
|
327
|
+
uv sync --dev
|
|
328
|
+
|
|
329
|
+
# Or with pip
|
|
330
|
+
pip install -e ".[dev]"
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Development Workflow
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
# Run all checks (recommended before committing)
|
|
337
|
+
uv run poe all
|
|
338
|
+
|
|
339
|
+
# Or run individual checks:
|
|
340
|
+
uv run poe lint # Check code quality with ruff
|
|
341
|
+
uv run poe format # Format code with ruff
|
|
342
|
+
uv run poe test # Run test suite with pytest
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
## Testing
|
|
346
|
+
|
|
347
|
+
### Running Tests
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
|
|
351
|
+
# Optional: Setup a venv using a specific python version
|
|
352
|
+
uv venv --python 3.11
|
|
353
|
+
|
|
354
|
+
# All Python tests with pytest
|
|
355
|
+
uv run poe test
|
|
356
|
+
|
|
357
|
+
# Specific test file
|
|
358
|
+
uv run poe test test/test_clone.py
|
|
359
|
+
# or
|
|
360
|
+
uv run pytest test/test_clone.py
|
|
361
|
+
|
|
362
|
+
# With verbose output
|
|
363
|
+
uv run poe test -vv
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
## Authors
|
|
367
|
+
|
|
368
|
+
**git-nested:**
|
|
369
|
+
- **Thorsten Klein** - Python rewrite and enhancements
|
|
370
|
+
|
|
371
|
+
**Original [git-subrepo](https://github.com/ingydotnet/git-subrepo) authors:**
|
|
372
|
+
- **Ingy döt Net** - Original concept and implementation
|
|
373
|
+
- **Magnus Carlsson** - Contributor
|
|
374
|
+
- **Austin Morgan** - Contributor
|
|
375
|
+
|
|
376
|
+
## License
|
|
377
|
+
|
|
378
|
+
MIT License
|
|
379
|
+
|
|
380
|
+
Copyright (c) 2026-present Thorsten Klein
|
|
381
|
+
|
|
382
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
383
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
384
|
+
in the Software without restriction, including without limitation the rights
|
|
385
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
386
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
387
|
+
furnished to do so, subject to the following conditions:
|
|
388
|
+
|
|
389
|
+
The above copyright notice and this permission notice shall be included in all
|
|
390
|
+
copies or substantial portions of the Software.
|
|
391
|
+
|
|
392
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
393
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
394
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
395
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
396
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
397
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
398
|
+
SOFTWARE.
|
|
399
|
+
|
|
400
|
+
## Acknowledgments
|
|
401
|
+
|
|
402
|
+
This project is based on [git-subrepo](https://github.com/ingydotnet/git-subrepo) by Ingy döt Net.
|
|
403
|
+
git-nested is a Python rewrite with some modified features and improvements.
|
|
404
|
+
|
|
405
|
+
## Resources
|
|
406
|
+
|
|
407
|
+
- **GitHub**: https://github.com/thorsten-klein/git-nested
|
|
408
|
+
- **Issues**: https://github.com/thorsten-klein/git-nested/issues
|
|
409
|
+
- **Documentation**: https://github.com/thorsten-klein/git-nested#readme
|
|
410
|
+
|
|
411
|
+
## Contributing
|
|
412
|
+
|
|
413
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
414
|
+
|
|
415
|
+
1. Fork the repository
|
|
416
|
+
2. Clone your fork locally
|
|
417
|
+
3. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
418
|
+
4. Make your changes and add tests
|
|
419
|
+
5. Run all checks (`uv run poe all`)
|
|
420
|
+
6. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
421
|
+
7. Push to your fork (`git push origin feature/amazing-feature`)
|
|
422
|
+
8. Open a Pull Request on GitHub
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
git_nested.py,sha256=Af_mvBpSkeqX6RBYE4fYE4bJJQIUHQcc106osQE09Oc,77929
|
|
2
|
+
git_nested-1.0.3.dist-info/licenses/LICENSE,sha256=E5U5iGWedRptRMJdjyZ9oSwBrd0iGiaIGcVZZGVF12Q,1110
|
|
3
|
+
git_nested-1.0.3.dist-info/METADATA,sha256=yTsLqkFG9JO3ex9AtTco1yo_7AbsRjlh7Sw7k6Td8Zc,12495
|
|
4
|
+
git_nested-1.0.3.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
5
|
+
git_nested-1.0.3.dist-info/entry_points.txt,sha256=OUPerDkqUUgWRK0IHEonBvKy9NVAyNxGRuBU53psHQI,47
|
|
6
|
+
git_nested-1.0.3.dist-info/top_level.txt,sha256=vu9h8Gv-4n4OsmpgDnYfBtD6rY9_fQ3Kf17lM3Ce80U,11
|
|
7
|
+
git_nested-1.0.3.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright 2026 - Thorsten Klein <thorsten.klein.git@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
git_nested
|