The problem
You're working on a project and you find yourself accumulating large files which are not well-suited for git leading you to add them to your .gitignore.
Months pass, and you find yourself wanting to share your repository including all of the large files which are now strewn about your repository and hidden from git.
At this point your options are limited to git-lfs (which now requires a paid subscription for truly large files) or linking to an external storage container outside of the repository which will often require refactoring.
Enter RepoPacker
RepoPacker is a command line tool built to work in harmony with Git to solve this problem. In a nutshell RepoPacker follows a simple workflow:
- You specify which files should be tracked by RepoPacker.
- RepoPacker collects tracked files and packs them into a standard zip file.
- When sharing the repository, the person downloading your code downloads both the repository and the zip file generated by RepoPacker.
- RepoPacker unpacks the zip file into the locations tracked by RepoPacker in your local repository.
The person downloading your code is left with a local git repository with the large files in their right place.
Installation
Installation requires git and python3.9+. Once you've installed the required dependencies you can install repopacker via pip:
pip install repopacker
Usage
Basic functionality
-
Add files: Add any large files / directories which you want tracked by RepoPacker:
repopacker add largefile.txt repopacker add dir/
This will create file named
.repopacker.jsonat the GitHub root of your project. It contains some basic config information and will act as a storage container for RepoPacker.This command does two things:
(1)
largefile.txtand all the files indirwill be added into the list of RepoPacker tracked files.(2)
largefile.txtand all the files indir
will be added to the.gitignorefor your project (you can disable this behavior by setting the.gitignoreflag in the.repopacker.jsonto false).Note: files tracked by RepoPacker will not have their changes tracked. All RepoPacker stores is a static link to the file.
-
Pack: Once you have added all the files you want tracked you can create a zip file,
repopacker pack repopack.zip
You should upload this to an accessible location such as dropbox or Zenodo. Optionally you can also add the link to the
downloadpathin the.repopacker.json. -
Unpack: Populate directories with large files in their original locations,
repopacker unpack repopack.zip
Easy downloading
- Setup: When running pack, RepoPack will store the hash for the pack in
the
.repopacker.json. You can setup a download link for your pack as,
repopacker config --downloadpath <your-download-link.zip>
- Download: You can now automatically download the zip and unpack as usual:
repopacker download repopack.zip
repopacker unpack repopack.zip
Note this will download a zip file from the internet. RepoPacker performs a basic checksum using the SHA256 hash of the file but this does not guarantee the zip file's integrity. Only use this option with repositories you can trust.
Additional utilities
-
Initialize: From an existing git repository initialize the RepoPacker system without adding any files first.
repopacker initThis is useful if you want to setup some configuration options before adding any files.
-
List files: See all files currently tracked by repopacker:
repopacker list -
Remove files: If you accidentally add files to RepoPacker that you shouldn't have you can remove them:
repopacker remove largefile.txt
This will also remove
largefile.txtfrom the.gitignoreif you have the option enabled. -
Configuration: See all configuration options:
repopacker config -h
-
Clean: When downloading an updated version of the repopacker.zip, it can be useful to clear all prexisting files tracked by RepoPacker:
repopacker clean
Gotchas
-
RepoPacker will attempt to zip your files into a single zip making it poorly suited to extremely large files (more than 100GB will probably become unwieldy).
-
To verify the integrity of zip files, RepoPacker will perform a checksum of the zipped file before unpacking. This can be slow for large zips. You can disable this behavior by modifying the config.
-
RepoPacker is not directly integrated with Git meaning any operations which update the file tree (like
git mv) will not be known to RepoPacker. You must remove these files and re-add them using RepoPacker for them to be properly tracked.
Metadata
Release files for repopacker 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| repopacker-0.2.1.tar.gz | 22.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| repopacker-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 46.6 kB
Release files / repopacker-0.2.1.tar.gz
| Download URL | repopacker-0.2.1.tar.gz |
|---|---|
| Size | 22.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3fb17d6d3f939495066e2d8aeea85e550badbeda01a06639532a812973eb8ec5
|
|
BLAKE2b-256 checksum How to use checksums |
e2fe64e8edc277206b3bf52cbf4059d333bc136ebafb574db0d204c3f4a06823
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.10.13 Darwin/23.4.0
|
Release files / repopacker-0.2.1-py3-none-any.whl
| Download URL | repopacker-0.2.1-py3-none-any.whl |
|---|---|
| Size | 24.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b0804d0c3ed202ba9f54aa303da07fa63ef48a8ec49c39e6b9a0d4f5a4c9eae
|
|
BLAKE2b-256 checksum How to use checksums |
86dd77c88c21828ff9fc700d62ce89c51e2d9580a6f5935a10b5822c6c0ace34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.10.13 Darwin/23.4.0
|
Security for repopacker 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.