GithubHelp home page GithubHelp logo

git-user-config's Introduction

Do you use different user names and/or email for your github projects, work projects, private personal projects?

Then you use git config a lot.

With git-user-config you can save these different users globally and configure a new repo with a single command using the user record id. No more misspelled email addresses and user names...

Install

npm install -g git-user-config

Add User record for later use

git-user-config --add

The follow instructions

Add new user record

id: user1
name: user 1
email: [email protected]

record saved

Configure git repo to use user record

git-user-config --set user1

This will call git config to set user.name and user.email

$ git config -l | grep user
user.name=user 1
[email protected]

List all user records

git-user-config --list
{
  "user1": {
    "name": "user 1",
    "email": "[email protected]"
  },
  "user2": {
    "name": "user 2",
    "email": "[email protected]"
  }
}

Remove a user record

git-user-config --remove user1

git-user-config's People

Contributors

palortoff avatar

Watchers

 avatar  avatar

Forkers

jsumners

git-user-config's Issues

Setting a non-existing user displays callstack

should only print error message

git-user-config -s github2
...\node_modules\git-user-config\src\commands\set.js:11
    if (!user || !user.name || !user.email) throw new Error(`User for ${id} not configured`);
                                            ^

Error: User for github2 not configured
    at set (...\node_modules\git-user-config\src\commands\set.js:11:51)
    at Object.<anonymous> (...\node_modules\git-user-config\index.js:17:10)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)
    at node.js:951:3

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.