Giter VIP home page Giter VIP logo

git-config-manager's Introduction

Work in progress

git-config-manager

Manage your git config like a pro

About

This small tool allows you to have multiple git configurations. The main reason that I created this tool it wasn't to have multiple git configurations, but instead being able to store the configuration outside of the main .gitconfig file and being able to commit my global .gitconfig to my dotfiles repository.

How does it work?

This is where your configuration will be stored.

~
├── .config
│   └── git-config-manager
│       ├── .gitconfig-main
│       ├── .gitconfig-personal
│       └── .gitconfig-work
├── .gitconfig
└── .vimrc

and your .gitconfig will look like this:

[include]
    path = ~/.config/git-config-manager/.gitconfig-main

[includeIf "gitdir:~/dev/personal/"]
    path = ~/.config/git-config-manager/.gitconfig-personal

[includeIf "gitdir:~/dev/work/"]
    path = ~/.config/git-config-manager/.gitconfig-work

To test that the correct profile is being used, navigate to one of your git repositories, for example:

cd ~/dev/personal/my-awesome-project

Note: You must be inside a git repository, and the icludeIf path must end on a /.

and run:

git config --get user.email

You should get the email for that specific profile. Test it with multiple profiles.

Usage

This still in development, so the usage might change.

git-config-manager <path-to-config>

Using 1Password

If you are using 1Password, you can inject the credentials using the op cli. Make sure you have the op cli installed and you replace the op path with your own.

op inject -i ./example/config.op.json -o ./example/config.json

git-config-manager's People

Contributors

abranhe avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.