🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@jsumners/git-user-config

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsumners/git-user-config

Configure your git user for current repo

latest
Source
npmnpm
Version
2.3.0
Version published
Weekly downloads
8
-38.46%
Maintainers
1
Weekly downloads
 
Created
Source

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 record identifiers. 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

Then follow instructions

Add new user record

Identifier: personal

Enter property names like `user.email`
Property name (none to end): user.name
Value: Joe Schmo
Property name (none to end): user.email
Value: joe@example.com
Property name (none to end):

record saved

Configure git repo to use user record

git-user-config --set user1

This will call git config --local for each property of the user1 configuration.

$ git config -l | grep user
user.name=user 1
user.email=user_1@domain.com

List all user records

git-user-config --list
{
  "user1": {
    "user.name": "user 1",
    "user.email": "user_1@domain.com"
  },
  "user2": {
    "user.name": "user 2",
    "user.email": "user_2@domain.com"
  }
}

Update a user record

git-user-config --update user1

This will interactively allow updating of the user1 record. The process works the same as --add user1. Any existing properties specified will be overwritten, or removed if the new value is ~del~, and new properties will be merged in.

Remove a user record

git-user-config --remove user1

FAQs

Package last updated on 25 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts