Skip to content

Commit 3b0420b

Browse files
committed
Add readme and license
1 parent 5cb2134 commit 3b0420b

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Tillie Kottmann
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# goop
2+
3+
Yet another tool to dump a git repository from a website. Code structure and console outputs heavily inspired by [arthaud/git-dumper](https://github.com/arthaud/git-dumper).
4+
5+
## Usage
6+
```bash
7+
usage: goop [flags] url [dir]
8+
9+
Flags:
10+
-f, --force overrides DIR if it already exists
11+
-h, --help help for goop
12+
```
13+
14+
### Example
15+
```bash
16+
$ goop example.com
17+
```
18+
19+
## Installation
20+
21+
```bash
22+
go get -u github.com/deletescape/goop
23+
```
24+
25+
## How does it work?
26+
27+
The tool will first check if directory listing is available. If it is, then it will just recursively download the .git directory (what you would do with `wget`).
28+
29+
If directory listing is not available, it will use several methods to find as many files as possible. Step by step, git-dumper will:
30+
* Fetch all common files (`.gitignore`, `.git/HEAD`, `.git/index`, etc.);
31+
* Find as many refs as possible (such as `refs/heads/master`, `refs/remotes/origin/HEAD`, etc.) by analyzing `.git/HEAD`, `.git/logs/HEAD`, `.git/config`, `.git/packed-refs` and so on;
32+
* Find as many objects (sha1) as possible by analyzing `.git/packed-refs`, `.git/index`, `.git/refs/*` and `.git/logs/*`;
33+
* Fetch all objects recursively, analyzing each commits to find their parents;
34+
* Run `git checkout .` to recover the current working tree

0 commit comments

Comments
 (0)