• This repository has been archived on 04/Feb/2022
  • Stars
    star
    8
  • Rank 2,099,232 (Top 42 %)
  • Language
    Haskell
  • License
    BSD 3-Clause "New...
  • Created over 8 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Manage git repository configurations with ease

git-config-manager

git-config-manager is a tool for setting git configurations by schemes described in json file. It is useful in situations when you can specify different sets of configurations for different repositories (like work, personal etc) and want to avoid typing configurations by hand for every single repository.

For example, consider following content in $XDG_CONFIG_HOME/git/git-config-manager.json (which is loaded by default if you donโ€™t override it using --config-file option).

{
  "personal": {
    "user": {
      "name": "The Donkey",
      "email": "[email protected]",
      "signingkey": "ABCDEFGH"
    }
  },
  "my_project": {
    "pull": {
      "rebase": true
    }
  },
  "work": {
    "user": {
      "name": "Mr. Doe",
      "email": "[email protected]",
      "signingkey": "ABCDEFGH"
    },
    "pull": {
      "rebase": null
    }
  }
}

You can navigate to any repository and call git-config-manager set personal to set all configurations under personal scheme.

Note that supported value types are strings, numbers and booleans. If you set the value to null, it will be unset (and in case corresponding section is empty it will be also removed).

Interface

$ git-config-manager --help
Git configuration manager

Usage: git-config-manager [--verbose] [--config-file PATH] COMMAND
  Manage git configurations and switch between them with ease

Available options:
  -h,--help                Show this help text
  --verbose                Enable verbose mode
  --config-file PATH       Specify configuration file path

Available commands:
  list                     List all available configuration schemes
  get                      Get list of currently used schemes
  set                      Set up configurations by scheme
  unset                    Unset configurations by scheme

Install

The easiest way to install git-config-manager is to use stack.

$ git clone https://github.com/d12frosted/git-config-manager.git
$ cd git-config-manager
$ stack install

Magit interface

Git configuration manager comes with magit interface. It just adds new section to status buffer. All available actions are available under C key. In order to set configuration scheme selected desired scheme and press C s. In order to unset it - C u.

Install

While package is not available on MELPA, one can install it using quelpa. After magit-gcm is available on your load-path, just add following snippet to your init.el.

(require 'magit-gcm)
(add-hook 'magit-mode-hook 'turn-on-magit-gcm)

Configure

There are several configuration variables available to users.

  • magit-gcm-exectuable - by default it searches for executable in PATH. If for some reason it canโ€™t be found or you just wish to manually specify it - set this variable.
  • magit-gcm-config-file - by default itโ€™s nil, which means that magit-gcm will not pass configuration file path to git-config-manager, so the default configuration file will be used. But in some cases it might be useful to manually set this variable.
  • magit-gcm-mode-lighter - mode line lighter for magit-gcm-mode.

For convenience, magit-gcm exposes several utility functions.

  • magit-gcm-exec - for executing git-config-manager commands.
  • magit-gcm-get-active-schemes - returns list of currently activated configuration schemes.
  • magit-gcm-get-available-schemes - returns list of all available configuration schemes.

More Repositories

1

homebrew-emacs-plus

Emacs Plus formulae for the Homebrew package manager
Ruby
2,314
star
2

vulpea

A collection of functions for note taking based on `org` and `org-roam`.
Emacs Lisp
237
star
3

flyspell-correct

Distraction-free words correction with flyspell via selected interface.
Emacs Lisp
200
star
4

environment

dotfiles
Emacs Lisp
124
star
5

elpa-mirror

Mirror for some Emacs package archives
Emacs Lisp
101
star
6

dotbot-brew

Install brew packages using dotbot
Python
46
star
7

vino

It's your cellar, your dear cantina.
Emacs Lisp
37
star
8

counsel-osx-app

Launch OSX applications via ivy interface
Emacs Lisp
24
star
9

UnityLibrarySwitcher

Unity plugin for switching build targets, git branches without endless assets reimport. Not maintained anymore.
C#
19
star
10

mirror-elpa

(To) mirror Emacs Lisp Package Archive(s)
Shell
8
star
11

d12frosted.io

Personal site
Haskell
8
star
12

orgability

Reading list manager for Emacs with offline access support.
Emacs Lisp
7
star
13

publicatorg

Make your vulpea notes public
Emacs Lisp
6
star
14

emacs-ukrainian-input-method

Ukrainian macOS-like input method
Emacs Lisp
5
star
15

fancy-yank

apply transformation upon yanking
Emacs Lisp
4
star
16

emacs-addiction-mode

M-x doctor instead of C-x C-c
Emacs Lisp
4
star
17

barberry.io

Emacs Lisp
3
star
18

org-drawer-list

Tame your lists in a drawer
Emacs Lisp
3
star
19

emacs-plus-basis

Emacs Lisp
3
star
20

CanonicalPath

Abstract data type for canonical paths with some pretty operations. Not maintained anymore.
Haskell
3
star
21

talks

TeX
2
star
22

env-extra

Safe helpers for accessing and modifying environment variables
Haskell
2
star
23

d12frosted

1
star
24

path-extra

Path helpers for my personal projects
Haskell
1
star
25

bomberman-player

Haskell
1
star
26

fish-mode

Major mode for editing fish shell scripts
Emacs Lisp
1
star