Repositories ============ .. cl:package:: cl-git .. cl:clos-class:: repository Creating -------- .. cl:generic:: init-repository .. code-block:: common-lisp-repl GIT> (init-repository #p"/tmp/test-repo/") # .. cl:generic:: empty-p .. code-block:: common-lisp-repl GIT> (empty-p (open-repository #p"/tmp/test-repo/")) T Bare ~~~~ Bare repositories can be created by passing a truthful value to the key argument BARE when initialising a repository. .. code-block:: common-lisp-repl GIT> (init-repository #p"/tmp/test-bare/" :bare t) # Whether an existing repository is bare can be determined using the bare-p method. .. cl:generic:: bare-p .. code-block:: common-lisp-repl GIT> (bare-p (open-repository #p"/tmp/test-bare/")) T Accessing --------- .. cl:generic:: open-repository .. code-block:: common-lisp-repl GIT> (open-repository #p"/home/russell/projects/ecl/") # GIT> (open-repository "/home/russell/projects/ecl/") # .. cl:macro:: with-repository :param pathname-or-string: the location of the repository. :param path: the path to the git repository. :param body: the body of the macro. .. code-block:: common-lisp-repl CL-GIT> (with-repository (repository #p"/home/russell/projects/ecl/") (prin1 repository) nil) # NIL Checkout -------- .. cl:generic:: checkout Head ---- .. cl:generic:: repository-head .. cl:generic:: head-detached-p .. cl:generic:: head-unborn-p Path ---- .. cl:generic:: repository-path .. cl:generic:: repository-workdir Status ------ .. cl:function:: repository-status .. code-block:: common-lisp-repl CL-GIT> (with-repository (repository #p"/home/russell/projects/lisp/cl-git/") (repository-status repository)) (("src/status.lisp" :CURRENT :WORKTREE-MODIFIED) ("src/package.lisp" :CURRENT :WORKTREE-MODIFIED) ("fabfile.pyc" :CURRENT :IGNORED) ("doc/repositories.rst" :CURRENT :WORKTREE-MODIFIED) ("doc/cl-git.html" :CURRENT :WORKTREE-NEW) ("doc/.installed.cfg" :CURRENT :IGNORED)) Configuration ------------- :doc:`Configuration ` details of a particular repository can be done with the :cl:symbol:`~GIT-CONFIG` method. .. cl:method:: git-config repository