Skip to main content

Bundle a local Git project with all uncommitted changes and stashes (git bundle on steroids).

Project description

Git Bundle Plus

Bundle a local git project with all uncommitted changes, unstaged files, and stashes (git bundle on steroids).

Contents

Requirements ✅

  • Python 3

Installation 🔌

Using pip

Use the package manager pip to install Git-Bundle-Plus.

pip install git-bundle-plus

Clone + Python 3

git clone https://github.com/an23lm/GitBundlePlus.git
python ./gitbundleplus [-h] path

Usage 👩‍💻

gitbundleplus [-h] path

-h : Help

path : Path to local git project folder you would like to bundle

⚠️ Note: After using gitbundleplus on a project the uncommitted and unstaged files will be statshed. You can easily retrieve these files by using git stash apply and drop the applied stash with git stash drop if you have no further need for it.

Example 👶

Bundle project

gitbundleplus ~/Documents/mygitproject

Unbundle project

git clone ~/Documents/mygitproject.bundle

Retrieve uncommited and unstanged changes

git stash apply ga-stash-tag-{ga-latest}

.bundle output + retrive git project 📦

<git-folder-name>.bundle will be created in the git folder specified.

To unbundle the bundled git project, clone the bundle.

git clone path/to/bundle

Restore the unstaged and uncommitted changes.

All the unstaged and uncommitted changes are stashed (git stash) and tagged (git tag) before bundling.

git stash apply ga-stash-tag-{ga-latest}

Delete the tag to drop the stash after your done applying.

git tag -d <tag-name>

Find and apply your previously stashed changes.

git tag list to view all your previously stashed changes, tagged with the pattern ga-stash-tag-{<stash-number>}. Apply and drop these tagged stashes as per your requirements.

git stash apply <tag-name>

Delete the tag to drop the stash after your done applying.

git tag -d <tag-name>
⚠️ Note: Unbundled projects do not checkout to your current working branch. They default to master branch. Please, take care to use git checkout <branch-name> to start using a particular branch before applying stashed changes.

Please read How it works for more information.

How it works ⚙️

  1. git stash list is run and all the previously stashed items are tagged with the pattern ga-stash-tag-{<stash-number>}. Example: git tag ga-stash-tag-{0} stash@{0}.
  2. Stash uncommited and unstaged changed using git stash -u. If a stash is created, this stash will be assigned the tag ga-stash-tag-{ga-latest}.
  3. Bundle the git project using git bundle <git-folder-name>.bundle and the bundle is placed in the git folder.
  4. All the tags from the original git project will be removed. Example: git tag -d ga-stash-tag-{0}.

Show some love ❤️

If you found this interesting or helpful, leave a star. ⭐️

Contributers 👨‍👩‍👧‍👦

Contribute 💪

Pull requests are welcome.

License 📃

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

Git_Bundle_Plus-0.9.1-py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page