Package: git-graph
Git-graphLearn (or teach) Git fast and well -by visualizing the inner graph of your Git repositoriesGit is a fast, scalable, distributed revision control system with an unusually rich command set
that provides both high-level operations and full access to internals.As wonderful as it may be, there is a downside coming with this "unusually rich command set", a kind of anxiety that affects beginners in particular and can be summed up in one question:"What the hell is going to happen to my repository if I launch this Git command ?"A good way to overcome this difficulty is to experiment.
This is made easy thanks to Git lightness and the fact it is immediately up and running in any directory withgit init.Git-graph is a Git plugin, written in Python, that displays your Git repository inner content as aDirected Acyclic Graph(DAG).
This structured visual representation of Git internal data demystifies the impact of each Git command and considerably improves the learning curve.InstallFrom PyPITo install Git-graph from PyPI:You first need to installGraphvizand check that the dot binary is correctly set in you system's path.Then run:pip install git-graphFrom GitHubTo install Git-graph from GitHub:You first need to installGraphvizand check that the dot binary is correctly set in you system's path.Then run:git clone https://github.com/hoduche/git-graphFinally, inside the newly created git-graph folder, run (with Python 3 and setuptools):python setup.py installRunAs a Git pluginGit-graph is a Git plugin that is run from a Git repository with the command:git graphRunninggit graphfrom a Git repository will:scan your.gitfolderbuild and save a graph representation of the.gitfolder internals as text (.dot) and image (PDF by default) in a.gitGraphfolderpopup a window that displays the image of your graphA color code helps in distinguishing in the graph the different kinds of object Git is using in its implementation:Object kindLetterRepresentationObject kindLetterRepresentationblobbremote branchrtreetremote headdcommitcremote serverslocal branchlannotated tagalocal headhtaggupstream linkuBy default all nodes are displayed in the output graph when runninggit graph.
It is possible to only display a user selection of object kinds using the-nor--nodesoption and picking the letters corresponding to your choice.For instance to only display blobs, trees and commits:git graph -n btcBy default Git-graph considers it is launched from a Git repository.
It is possible to indicate the path to another Git repository with the-por--pathoption:git graph -p examples/demoThe default output format is PDF.
Other output graphics formats (either vector or raster) can be set with the-for--formatoption:(the full list of possible formats can be found on theGraphviz documentation website)git graph -f svgFinally it is possible to prevent the graph image from poping up once constructed, with the-cor--concealoption:git graph -cAs a Python programpython git_graph/cli.py -p examples/demo -n btc -f svgor./git_graph/cli.py -p examples/demo -n btc -f svgAs a Python moduleimportgit_graph.dot_graphasdgdg.DotGraph('..').persist()dg.DotGraph('../examples/demo',nodes='btc').persist(form='svg',conceal=True)