Skip to content

Nodejs tool useful to switch between git accounts at global level (~/.gitconfig)

License

Notifications You must be signed in to change notification settings

francescochiapello/git-global-account-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-global-account-manager

Nodejs tool useful to switch between git accounts at global level (~/.gitconfig)

If you have multiple git accounts (eg. Personal account and/or Companies accounts) and you want to code on different projects at the same time on the same machine you should modify user.name and user.email into ~/.gitconfig otherwise your commit will be pushed with a wrong name.

Simply create a JSON file under HOME path named ~/.gam.json with an array of accounts

[
  {
    "name": "John Smith",
    "email": "[email protected]"
  },
  {
    "name": "John Smith",
    "email": "[email protected]"
  },
  {
    "name": "Company Name",
    "email": "[email protected]"
  }
]

then run the command gam and select Show configuration to list actual configured profile or Set profile :: ... to configure the desidered one

  @ Git Account Manager @
? Select Git Account to set as global (Use arrow keys or type to search)
 Show configuration
  Set profile :: <John Smith>
  Set profile :: <John Smith>
  Set profile :: <Company Name>

About

Nodejs tool useful to switch between git accounts at global level (~/.gitconfig)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published