Skip to content
A command line tool allowing for easy shifting between git identities (username, email, and signing key (e.g. GPG)).
C Other
  1. C 99.9%
  2. Other 0.1%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
extra
include
lib
scripts Adding lint.sh script, .clang-format, and LICENSE Jan 26, 2020
src
test
.clang-format
.gitattributes
.gitignore
LICENSE
Makefile
README.md

README.md

gitid

gitid-logo

GitHub CircleCI Codacy Badge

A command line tool allowing for easy shifting between git identities (username, email, and signing key (e.g GPG)). A lighter, more portable rewrite of git-identity in C.

Usage

Usage: gitid [-valch] [-s <id-name>] [-n <id-name>] [-u <id-name>] [-d <id-name>] [--global] [--local] [--user=<username>] [--email=<email>] [--sigkey=<sigkey>]
A command line tool allowing for easy shifting between git identities (username, email, and signing key).

  -v, --version             output the version number
  -a, --about               about this tool
  -l, --list                list all registered identities
  -c, --current             current global git identity
  -s, --shift=<id-name>     shift git identity to registered identity (global by default)
  -n, --new=<id-name>       add new identity
  -u, --update=<id-name>    update registered identity
  -d, --delete=<id-name>    delete registered identity
  -h, --help                display this help and exit

Additional flags:

-c, --current, --s, --shift:
  --global                  refer to global git config
  --local                   refer to local git config (repository-level)

-n, --new, -u, --update:
  --user=<username>         specify username
  --email=<email>           specify email
  --sigkey=<sigkey>         specify signing key (key-id format: LONG)

Building

Building is very simple, simply run make, and it'll produce an executable gitid.

Installation

Linux

To install, simply extract the tool into a preferred directory, build, and create a soft link. For example, if you are looking to place the tool in your home directory:

unzip gitid-0.2.1-alpha.zip -d ~/
cd ~/gitid-0.2.1-alpha
make
sudo ln -s ~/gitid-0.2.1-alpha/gitid /usr/local/bin/gitid

Doing this should make it globally accessible via gitid.

Testing

Run make && ./a.out in the test/ directory to run all tests. For simplicity, some tests are not automated, and ask for runner confirmation to ensure that the output is valid (e.g. gitid_id_min_write).

To easily confirm this output, an additional script has been added to the test makefile. Simply run make out to execute.

License

This code has been licensed under the GNU General Public License v3.0.

You can’t perform that action at this time.