https://github.com/pmiossec/git-prepare-save
https://github.com/pmiossec/git-prepare-save
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pmiossec/git-prepare-save
- Owner: pmiossec
- Created: 2017-12-02T13:53:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-10T19:46:49.000Z (about 6 years ago)
- Last Synced: 2025-06-29T13:04:22.595Z (12 months ago)
- Language: Shell
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# git prepare-save
# Goal
Git script that could be used to prepare a git repository for:
* copy/move elsewhere efficiently
* backuping
It will store all the changes and data in the git repository and empty the working directory (no data lost!).
# What do it do
1. Verify that the folder is a git repository
1. Save all the working directory changes in a stash
1. Garbage collect the git repository to create big pack files easy to copy (and with a total size smaller)
1. Delete all the files and folders tracked in the working directory folder
1. You could then copy efficiently the folder somewhere else
1. You could restore the working directory content with: `git reset --hard HEAD`"
# Use
* In a git repository folder
`git prepare-save`
* In a folder containing a lot of git repositories as sub-folders
`git prepare-save-all`