In my organization, multiple programmers are developing with shared accounts in the robot.
I recently started managing the source code on GitHub, but note that user management when committing was a little troublesome when developing in the same repository in the robot.
I want to switch between multiple accounts within the same repository, but when I looked it up, I could only find a way to set it for each repository.
Since users change frequently, it is troublesome to rewrite gitconfig each time, and it seems to be forgotten.
I wrote a script to check committers before committing.
The source code can be found here [https://github.com/DaikiMaekawa/git-check-committer).
Commit normally.
$ git commit -m "msg"
Account information is displayed
Enter y to commit normally.
You can reset your account by typing n.
Author = USER_NAME <USER_EMAIL> Do you want to me to keep it this way? [y/n] n
Set up a new account.
Username:NEW_USER_NAME
Email:NEW_USER_EMAIL
Please commit that again...
You will be asked to commit again.
$ git commit -m "msg"
Check the updated account information and enter y if there is no problem.
Author = NEW_USER_EMAIL <NEW_USER_EMAIL>
Recommended Posts