PageRenderTime 45ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/README.md

https://gitlab.com/leijianbin/gitdocs
Markdown | 210 lines | 150 code | 60 blank | 0 comment | 0 complexity | 9c1090cabf90dede75cbae42d550b14d MD5 | raw file
  1. # Gitdocs
  2. [![Gem Version](https://badge.fury.io/rb/gitdocs.png)](http://badge.fury.io/rb/gitdocs)
  3. [![Code Climate](https://codeclimate.com/github/bazaarlabs/gitdocs.png)](https://codeclimate.com/github/bazaarlabs/gitdocs)
  4. [![Build Status](https://travis-ci.org/nesquena/gitdocs.svg?branch=master)](https://travis-ci.org/nesquena/gitdocs)
  5. [![Inline docs](http://inch-ci.org/github/nesquena/gitdocs.png?branch=master)](http://inch-ci.org/github/nesquena/gitdocs)
  6. [![Dependency Status](https://gemnasium.com/nesquena/gitdocs.svg)](https://gemnasium.com/nesquena/gitdocs)
  7. [![Coverage Status](https://coveralls.io/repos/nesquena/gitdocs/badge.png?branch=master)](https://coveralls.io/r/nesquena/gitdocs)
  8. Open-source dropbox alternative powered by git. Collaborate on files and tasks without any extra hassle.
  9. gitdocs will automatically keep everyone's repos in sync by pushing and pulling changes.
  10. This allows any git repo to be used as a collaborative task list, file share, or wiki for a team.
  11. Supports a web front-end allowing each repo to be accessed through your browser.
  12. **Note:** Gitdocs has been tested on multiple unix systems including Mac OS X and Ubuntu.
  13. Windows support is [half-baked](https://github.com/nesquena/gitdocs/issues/7)
  14. but we plan to tackle that shortly in an upcoming release.
  15. ## Why?
  16. Why use gitdocs for your file and doc sharing needs?
  17. * **Open** - gitdocs is entirely open-source under the MIT license
  18. * **Simple** - gitdocs is the simplest thing that works in both setup and usage
  19. * **Secure** - gitdocs leverages git (and existing providers like github) to store your data safely.
  20. * **Versatile** - share task lists, code snippets, images, files or just use it as a wiki (with our web front-end).
  21. * **Portable** - access your files on any client that can use git.
  22. The best part is that getting started using this project is quick and simple.
  23. ## Quick Start
  24. Gitdocs monitors any number of directories for changes and keeps them automatically synced. You can either add
  25. existing git directories to be watched or have gitdocs pull down a repository for you.
  26. There are plenty of great git hosting providers to safely store your data and you can trust the data is stored securely.
  27. If you want a private repo to use with gitdocs, we recommend you check out [BitBucket](https://bitbucket.org/) which
  28. provides free private git repos after registration.
  29. To get started with gitdocs and a secure private bitbucket repo:
  30. - `gem install gitdocs`
  31. - `gitdocs start`
  32. - Login to [BitBucket](https://bitbucket.org/) and add a new private repo named 'docs'
  33. - Setup your SSH Key under [Account](https://bitbucket.org/account/) for ssh access
  34. - `gitdocs create ~/Documents/gitdocs git@bitbucket.org:username/docs.git`
  35. There you go! Now just start adding and editing files within the directory and they will be automatically
  36. synchronized across all gitdocs-enabled clients.
  37. ## Installation
  38. Requires ruby1.9+ and rubygems. Install as a gem:
  39. ```
  40. gem install gitdocs
  41. ```
  42. If you have Growl installed on Max OSX, you'll probably want to run:
  43. ```
  44. brew install growlnotify
  45. ```
  46. to enable Growl notification support.
  47. ## Usage
  48. ### Starting Gitdocs
  49. You need to start gitdocs in order for the monitoring to work:
  50. ```
  51. gitdocs start
  52. ```
  53. If the start command fails, you can check the logs in `~/.gitdocs/log` or run again with the debug flag:
  54. ```
  55. gitdocs start -D
  56. ```
  57. Once gitdocs has been started and is monitoring the correct directories, simply start editing or adding files to your
  58. designated git repos and changes will be automatically pushed. Gitdocs can be easily stopped or restarted:
  59. ```
  60. gitdocs stop
  61. gitdocs restart
  62. ```
  63. For an overview of gitdocs current status, run:
  64. ```
  65. gitdocs status
  66. ```
  67. ### Monitoring Shares
  68. You can add existing folders to watch:
  69. ```
  70. gitdocs add my/path/to/watch
  71. ```
  72. or instruct gitdocs to fetch a remote share and keep it synced with:
  73. ```
  74. gitdocs create local/path/for/repo git@github.com:user/some/remote/repo.git
  75. ```
  76. This will clone the remote repo and begin monitoring the local path. You can remove and clear monitored paths as well:
  77. ```
  78. gitdocs rm my/path/to/watch
  79. gitdocs clear
  80. ```
  81. ### Web Front-end
  82. Gitdocs come with a handy web front-end that is available.
  83. <a href="http://i.imgur.com/IMwqN.png">
  84. <img src="http://i.imgur.com/IMwqN.png" width="250" />
  85. </a>
  86. <a href="http://i.imgur.com/0wVyB.png">
  87. <img src="http://i.imgur.com/0wVyB.png" width="250" />
  88. </a>
  89. <a href="http://i.imgur.com/Ijyo9.png">
  90. <img src="http://i.imgur.com/Ijyo9.png" width="250" />
  91. </a>
  92. This browser front-end supports the following features:
  93. * Explore the files within all your shares
  94. * View revision history for every file in your share
  95. * Revert a file to any previous state in the file's history
  96. * View source files in your shares with code syntax highlighting
  97. * View text files in your shares with smart formatting (markdown, textile)
  98. * View any file in your shares that can be rendered inline (pdf, images, et al)
  99. * Edit and update text files using a text editor
  100. * Upload and create new files within your shares
  101. * Manage share settings and other configuration options
  102. To check out the front-end, simply visit `http://localhost:8888` whenever gitdocs is running.
  103. ### Conflict Resolution
  104. Proper conflict resolution is an important part of any good doc and file collaboration tool.
  105. In most cases, git does a good job of handling file merges for you. Still, what about cases where the conflict cannot be
  106. resolved automatically?
  107. Don't worry, gitdocs makes handling this simple. In the event of a conflict,
  108. **all the different versions of a document are stored** in the repo tagged with the **git sha** for each
  109. committed version. The members of the repo can then compare all versions and resolve the conflict.
  110. ## Gitdocs in Practice
  111. At Miso, our team actually uses gitdocs in conjunction with Dropbox. We find Dropbox is ideal for galleries, videos,
  112. and large binary files of all sorts. We use gitdocs for storing our actual "docs":
  113. Task lists, wiki pages, planning docs, collaborative designs, notes, guides, code snippets, etc.
  114. You will find that the gitdocs browser front-end is well suited for this usage scenario
  115. since you can browse formatted wiki pages, view files with smart syntax highlighting,
  116. edit files with a rich text editor, search all your files, as well as view individual file revision histories.
  117. ## Planned Features
  118. Gitdocs is a young project but we have many plans for it including:
  119. - Better handling of large binary files circumventing known git limitations
  120. - Click-to-share instant access granting file access to users using a local tunnel or other means.
  121. - Tagging and organizing of files within the web front-end
  122. - Better access to the versions for a particular file within the web front-end
  123. ## Contributors
  124. Gitdocs is now primarily being developed by [Andrew Sullivan Cant](https://github.com/acant). Gitdocs was created at [Miso](http://engineering.gomiso.com) by [Joshua Hull](https://github.com/joshbuddy) and [Nathan Esquenazi](https://github.com/nesquena).
  125. We also have had several contributors:
  126. * [Chris Kempson](https://github.com/ChrisKempson) - Encoding issues
  127. * [Evan Tatarka](https://github.com/evant) - Front-end style fixes
  128. * [Kale Worsley](https://github.com/kaleworsley) - Custom commit msgs, revert revisions, front-end cleanup
  129. * [Andrew Sullivan Cant](https://github.com/acant) - Major improvements, grit support, core contributor
  130. Gitdocs is still a young project with a lot of opportunity for contributions. Patches welcome!
  131. ## Prior Projects
  132. Gitdocs is a fresh project that we originally spiked on in a few days time. Our primary goals are to keep the code as simple as possible,
  133. but provide the features that makes Dropbox great. If you are interested in other Dropbox alternatives, be sure to checkout our notes below:
  134. * [SparkleShare](http://sparkleshare.org/) is an open source, self-hosted Dropbox alternative written using C# and the [Mono Project](http://www.mono-project.com/Main_Page).
  135. More mature but has a lot of dependencies, and lacks some of the features planned in Gitdocs.
  136. * [DVCS-Autosync](http://mayrhofer.eu.org/dvcs-autosync) is a project to create an open source replacement for Dropbox based on distributed version control systems.
  137. Very similar project but again we have features planned that are out of scope (local tunnel file sharing, complete web ui for browsing, uploading and editing).
  138. * [Lipsync](https://github.com/philcryer/lipsync) is another similar project. We haven't looked at this too closely, but thought we would mention it in this list.
  139. * [bitpocket](https://github.com/sickill/bitpocket) is a project that uses rsync to synchronize data. Interesting concept, but
  140. lacks revision history, author tracking, etc and we have features planned that are out of scope for this project
  141. * [RubyDrop](https://github.com/meltingice/RubyDrop) git backed DropBox clone
  142. * [git-sync](http://tychoish.com/essay/git-sync/) manual git syncing tool,
  143. which also use XMPP notifications
  144. * [git-annex-assistant](http://git-annex.branchable.com/design/assistant/)
  145. directory sync tool based on [git-annex](http://git-annex.branchable.com/). (written in Haskell)
  146. * [BitTorrent Sync](http://www.bittorrent.com/sync) BitTorrent based syncing
  147. tool, not open source or publicly defined protocol
  148. * [StrongSync](https://secure.expandrive.com/strongsync) Dropbox clone utility,
  149. proprietary
  150. If any other open-source dropbox alternatives are available, we would love to hear about them so let us know!