Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steeve/git-fast-import-go
https://github.com/steeve/git-fast-import-go
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/steeve/git-fast-import-go
- Owner: steeve
- Created: 2015-04-27T16:03:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-04-27T16:10:34.000Z (over 9 years ago)
- Last Synced: 2024-12-22T22:17:19.433Z (15 days ago)
- Language: Go
- Size: 113 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# git-fast-import-go
This is a package to easily create streams for `git fast-import`.
## How to get
```
$ go get https://github.com/steeve/git-fast-import-go
```## How to use
```go
committer := &gitfastimport.Signature{
Name: "Foo Bar",
Email: "[email protected]",
When: time.Now()
}gitfastimport.WriteCommit(os.Stdout, "refs/heads/master", "git message", Committer, Committer)
gitfastimport.WriteFileModify(os.Stdout, 644, "myfile.txt")
gitfastimport.WriteDataBegin(os.Stdout)
os.Stdout.Write([]byte("File content"))
gitfastimport.WriteDataEnd(os.Stdout)
```Then run:
```
$ go run program.go | git fast-import
```