Skip to content

Synchronize your working directory efficiently to a remote place without committing the changes.

License

Notifications You must be signed in to change notification settings

pfnet-research/git-ghost

Repository files navigation

git-ghost

GoDoc Build Status Coverage Status

Git Ghost is a command line tool for synchronizing your working directory efficiently to a remote place without commiting changes.

Concept

Git Ghost creates 2 types of branches to synchronize your working directory.

Commits Branch

This type of branch contains commits between 2 commits which can exist only in your working directory.

Diff Branch

This type of branch contains modifications from a specific commit in your working directory.

Installing

From Source

Install the binary from source: execute,

$ git clone https://github.com/pfnet-research/git-ghost
$ cd git-ghost
$ make install

Compiled binary is located in dist folder.

Releases

The binaries of each releases are available in Releases.

Getting Started

First, create an empty repository which can be accessible from a remote place. Set the URL as GIT_GHOST_REPO env.

Assume your have a local working directory DIR_L and a remote directory to be synchronized DIR_R.

Case 1 (DIR_L HEAD == DIR_R HEAD)

You can synchoronize local modifications.

$ cd <DIR_L>
$ git-ghost push
<HASH>
$ git-ghost show <HASH>
...
$ cd <DIR_R>
$ git-ghost pull <HASH>

Case 2 (DIR_L HEAD > DIR_R HEAD)

You can synchronize local commits and modifications.

Assume DIR_R's HEAD is HASH_R.

$ cd <DIR_L>
$ git-ghost push all <HASH_R>
<HASH_1> <HASH_2>
<HASH_3>
$ git-ghost show all <HASH_2> <HASH_3>
...
$ cd <DIR_R>
$ git-ghost pull all <HASH_2> <HASH_3>

Development

# checkout this repo to $GOPATH/src/git-ghost
$ cd $GOPATH/src
$ git clone [email protected]:pfnet-research/git-ghost.git
$ cd git-ghost

# build
$ make build

# see godoc
$ go get golang.org/x/tools/cmd/godoc
$ godoc -http=:6060  # access http://localhost:6060 in browser

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Release

Release flow is fully automated. All the maintainer need to do is just to approve and merge the next release PR

Copyright

Copyright (c) 2019 Preferred Networks. See LICENSE for details.