Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/steeve/git-fast-import-go


https://github.com/steeve/git-fast-import-go

Last synced: 11 days ago
JSON representation

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
```