gitconfig

https://github.com/tonini/gitconfig.el.git

git clone 'git://github.com/tonini/gitconfig.el.git'
7

gitconfig.el

Emacs lisp interface to work with git-config variables

Installation

ELPA

gitconfig.el is available on both community maintained repositories - Marmalade and MELPA. Just run M-x package-install [RET] gitconfig [RET] inside your emacs and you're ready to go.

If you're not already using ELPA, check the emacswiki page to get familiar with it.

Manual

(add-to-list 'load-path "~/path/to/gitconfig.el/")
(require 'gitconfig)

Usage

Interactive functions

Command (For the M-x prompt.) Description
gitconfig-execute-command Run git config with custom ARGUMENTS and display it in the gitconfig-buffer-name

Non-interactive functions

Function Description
(gitconfig-current-inside-git-repository-p) Return t if default-directory is a git repository
(gitconfig-path-to-git-repository) Return the absolute path of the current git repository
(gitconfig-get-variables LOCATION) Get all variables for the given LOCATION and return it as a hash table
(gitconfig-set-variable LOCATION NAME VALUE) Set a specific LOCATION variable with a given NAME and VALUE
(gitconfig-get-variable LOCATION NAME) Return a specific LOCATION variable for the given NAME
(gitconfig-delete-variable LOCATION NAME) Delete a specific LOCATION variable for the given NAME
(gitconfig-get-local-variables) Return all git config --local --list variables as hash table
(gitconfig-get-global-variables) Return all git config --global --list variables as hash table
(gitconfig-get-system-variables) Return all git config --system --list variables as hash table
(gitconfig-get-local-variable NAME) Return a specific git config --local --list variable by the given NAME
(gitconfig-get-global-variable NAME) Return a specific git config --global --list variable by the given NAME
(gitconfig-get-system-variable NAME) Return a specific git config --system --list variable by the given NAME

Configuration

gitconfig-git-command Path to the executable git shell command.

(setq gitconfig-git-command "/usr/local/bin/git")

gitconfig-buffer-name Name of the buffer used for git shell output.

(setq gitconfig-buffer-name "*GITCONFIG*")

Contributions are very welcome!

  1. Fork gitconfig.el
  2. Create a topic branch - git checkout -b my_branch
  3. Push to your branch - git push origin my_branch
  4. Send me a pull-request for your topic branch
  5. That's it!