Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

atlas-git-identity

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atlas-git-identity

A CLI tool which sets a git repository's author based on package.json or arguments.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

atlas-git-identity

A CLI tool which sets a git repository's author based on package.json or arguments.

Travis


install

npm install -g atlas-git-identity

Note: make sure you install this globally (-g) unless you're using the API for a local project.

why

There are few things that are more annoying than Gravatar leaking your identity to nearly everything you touch with your e-hands. Similarly with git, you might be surprised when you look back on some of your commits and realize they've been authored under your real name. Some people don't care, but this really bothers me as my real name is so common, it makes everything I do much less interesting.

Do yourself a favor and run:

git config --global user.useConfigOnly true

After running this, your machine will force you to set a local identity on all of your git projects. At least for me, this extra configuration work when I start a new project is well worth the peace of mind (i.e. my privacy). This CLI tool aims to eliminate the extra work I put on myself.

examples

cli tool

After installing this package, the command below will automatically set your git identity for the current project based on your package.json's "author" field:

git-identity

If you don't have this field, you can also specify your name and email as arguments:

git-identity atlassubbed atlassubbed@gmail.com
api

You can also do all of the above programmatically:

const { parseAuthor, setIdentity } = require("atlas-git-identity");

const stringAuthor = "atlassubbed <atlassubbed@gmail.com>"
const author = parseAuthor(stringAuthor)
setIdentity(author, process.cwd(), err => {
  if (!err) console.log("success!")
})

We can directly set whichever of the git config "user" fields we want:

...
setIdentity({name:"atlassubbed"}, err => {
  if (!err) console.log("success!")
})

We can set any number of the git config "user" fields:

setIdentity({name: "atlassubbed", signingkey: "123"}, err => {
  if (!err) console.log("success!")
})

caveats

At first, this package automatically ran git config --global user.useConfigOnly true to remove that step as well, however it's a bad idea because it may not be desired on some machines. Furthermore, the step only needs to be run once and is entirely optional, so it's not a problem. Please run this command separately if you would like to force a local identity on your git projects.

Keywords

FAQs

Package last updated on 28 Jun 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc