Harish
Harish

Reputation: 95

Configuring Git Account VSCode

I ran into a problem where I have made edits to a repository(org repo) and committed them with my personal git account accidentally. As a result, the commit history on the repo shows that the Committed & Authored identities are from the personal account rather than the official account. Are there any plugins or validation that can be enforced for each repo before committing the changes?

Or is there any efficient way to manage multiple git hub accounts?

I am on windows and using VS Code as IDE.

Upvotes: 1

Views: 4114

Answers (1)

VonC
VonC

Reputation: 1323553

I always prefer to use (as documented here):

git config --global user.useConfigOnly true

That way, I am forced to set the right user.name/email on each new local Git repository, in the local Git configuration of the specific repository.

Any tool manipulating the repository (like VSCode making new commits) would then benefit from the right user.

The OP Bugata also mentions in the comments the extension "Git-Identity switcher"

I am able to view the Author while editing itself.

Upvotes: 3

Related Questions