https://github.com/tomaskraus/repo-extract
Creates a repository from a subdirectory of original repository, preserves its history.
https://github.com/tomaskraus/repo-extract
Last synced: 2 months ago
JSON representation
Creates a repository from a subdirectory of original repository, preserves its history.
- Host: GitHub
- URL: https://github.com/tomaskraus/repo-extract
- Owner: tomaskraus
- License: mit
- Created: 2016-12-19T19:58:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-06T04:55:07.000Z (over 8 years ago)
- Last Synced: 2025-02-04T19:24:29.908Z (4 months ago)
- Language: Shell
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
repo-extract
------------```
<<< repo-extract - Git project isolation tool >>>
Extract a directory from git repository to a new repository, with directory history preserved.
In detail: Isolates a subdirectory from a repository cloned from a remote, using filter-branch git command.
Creates a new repository with that subdirectory content at the root.
That new repository is then pushed to the destination remote.usage: repo-extract.sh []
if is not specified, uses a local, temporary remote as a destination. This is a safe, non-destructive option for testing purposes.
if is set to ".", the repository from source-remote is just "pushed" to the destination-remoteAt the end, clones a temporary repository from the updated destination-remote, to see the fresh result.
note: provide an absolute path (or URL) for and parameters
note: if is specified, that destination-remote must already existsexample: repo-extract.sh "https://github.com/user/all-project" project1 project-1 "https://github.com/user/project-1"
```### tip
When extracting multiple directories from one source-remote repository, speed-up the cloning process by clone that remote repository to your machine first, and then use that cloned one as a local source-remote.
### more examples
preview the result, without a modification of the destination remote:
```
. repo-extract.sh "https://github.com/user/all-project" project1 project-1
```
the result repository will be at: `./temp/project-1`### see also
[moving-files-from-one-git-repository-to-another-preserving-history](http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/)