Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

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.

Filename, size & hash SHA256 hash help File type Python version Upload date
Git_Bundle_Plus-0.9.1-py3-none-any.whl (7.8 kB) Copy SHA256 hash SHA256 Wheel py3

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page