Getting started with Git Profile Manager

TL;DR: I published a simple CLI tool to manage switching between complex Git configs. You can find all the docs and details here, the source here and download it here

I've recently published a new command line utility: Git Profile Manager.

Git Profile Manager (GPM) was originally intended purely as a demo for .NET Core native publishing during a conference presentation. As it happened, the tool worked a little better than I thought so I kept hacking on it so I published it earlier this year for anyone who finds it useful!

What does it do?

Git Profile Manager, as the name suggests, manages Git profiles. What that means is collections of Git configuration options. As a practical example, I work on a lot of different Git projects, and many of them have different configuration requirements:

  • Cake: Sign all commits with Keybase key, commit with address
  • Other GitHub projects: sign with Keybase key, commit with personal email, whole suite of aliases
  • Work projects: sign with internal key and internal address, no auto CRLF detection, custom commit message template

Likewise, I use different diff tools for different projects, I only use aliases for some complex projects, and projects using submodules need some extra config.

Now, I could sit there and run git config commands for ages (used to do that), or write up project-specific shell scripts (recently did that), but now I can simply create "profiles" with GPM that contain a set of configuration options for each project or type of project. Now, when I clone a new work project, I just run:

gpm activate work-profile

and the repo is immediately configured with my work keys and our team's customised Git configs.

On the same workstation, I can start a new Cake project, run gpm activate cake and now I'm using my Cake configuration (including my Keybase key for signing commits).

Plus, since you can activate multiple profiles at the same time, I can quickly run gpm activate submodules and add submodule-specific config without affecting the rest of the repo. I can also take my existing shell scripts and use gpm profile import /path/to/ and convert them easily into profiles that are stored in my home folder.

GPM supports a whole host of commands for easily activating, deactivating and manipulating profiles, and they're all detailed in the documentation.

How do I get it?

The easiest way (in my opinion) is as a .NET Core global tool: just run dotnet tool install -g git-profile-manager and gpm should be ready to go.

Native packages are also available for Windows as well as a range of Linux distributions (Ubuntu, Debian, RHEL, CentOS).

You can also download the latest release and manually extract it to your PC, if you don't want to install it!


comments powered by Disqus