Skip to content
/ yagg Public

Yet Another Git Gist for sharing code or text snippets. It also helps us in creating, editing, downloading gists as well as keeping track of the changes made.

License

Notifications You must be signed in to change notification settings

Khusbu/yagg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yagg

Yet Another Git Gist is a no-database public git-gist.

Utility

It's an user-friendly web-app designed primarily to keep a record of text snippets using light-weight git. Gists can be created and shared locally (for e.g. in an organization). The changes can be tracked easily. One can also view the list of gists and edit, delete, download, remove etc. as required.

Installation

  • Install cmake from brew or apt-get package manager. To build from source, follow this link

  • Install libgit2 as follows :

      $ wget https://github.com/libgit2/libgit2/archive/v0.23.4.tar.gz
      $ tar xzf v0.23.4.tar.gz
      $ cd libgit2-0.23.4/
      $ cmake .
      $ make
      $ sudo make install
    
  • Install go packages as folloes :

      $ go get github.com/libgit2/git2go
    
  • Build the project using :

      $ go build
    
  • Troubleshooting:-
    ImportError: libgit2.so.0: cannot open shared object file: No such file or directory
    This happens for instance in Ubuntu, the libgit2 library is installed within the /usr/local/lib directory, but the linker does not look for it there. To fix this call

      $ sudo ldconfig
    

Server Side Commands:

yagg  [-b] [-h] [-p] [-r]

Options:

-h Used for getting the usage of the flags.

-r path/to/save/repo Used to set the repository path where the git-gist repository will be saved. If nothing is specified, data folder in the present working directory will be set as the default path.

-p port-number Used to specify the port used by YAGG. Port 8080 will be used by default.

-b host-name Used to set the hostname for the server. If nothing is specified, 0.0.0.0 will be used as the host.

How to use:

  • Run the server at 0.0.0.0:8080 using command :

    $ yagg -b 0.0.0.0 -p 8080
    
  • Let's create our first gist main.go

    • http://0.0.0.0:8080/

    Create-gist-image

  • View

    • http://0.0.0.0:8080/show/gist-name
    • http://0.0.0.0:8080/show-by-id/gist-name/commit-id

    View-gist-image

  • Edit

    • http://0.0.0.0:8080/edit/gist-name

    Edit-gist-image

  • Track the changes

    • http://0.0.0.0:8080/history/gist-name

    History-gist-image

  • Generate raw file

    • wget http://0.0.0.0:8080/raw/gist-name

    • wget http://0.0.0.0:8080/raw-by-id/gist-name/commit-id

    Raw-gist-image

  • Download

    -http://0.0.0.0:8080/download/gist-name

    -http://0.0.0.0:8080/download-by-id/gist-name/commit-id

  • Delete

    -http://0.0.0.0:8080/remove/gist-name

  • View all:

    -http://0.0.0.0:8080/list

    List-gist-image

To-do:

  • Sorting gists in the list page based on options like last updated, etc. Currently gists are sorted in the order of gist-name
  • Search field to be included
  • Option of uploading a file as a gist
  • Creating user-specific gists
  • User Interface to be enhanced

References

About

Yet Another Git Gist for sharing code or text snippets. It also helps us in creating, editing, downloading gists as well as keeping track of the changes made.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published