Ninety-nine percent of time our team commits on local development boxes and pushes commits, in which case the authorship info on commits is correct. However, under times of high-stress someone will tweak something directly on the dev server and commit from there. When that happens the author info in the commit defaults to the shared deployment account.
Is there a way to prompt users for their author info on commit? They're not going to remember to do --author
.
Some things I've looked at, but couldn't quite get across the finish line are:
Is there a way to get one of those to work or a good way to do it?
In the text box below your commit message, add Co-authored-by: name <[email protected]> with specific information for each co-author. If you're adding multiple co-authors, give each co-author their own line and Co-authored-by: commit trailer. Click Commit changes or Propose changes.
Okay, I found a way to do this, but it works only because we exclusively access this box over ssh using key based authentication.
In the shared deploy user's /home/deploy/.ssh/authorized_keys
file I added an environment variable per key so that mine, for example, looks like this:
environment="[email protected]",environment="GIT_AUTHOR_NAME=Ry4an on Dev" ssh-rsa AAAA...cXBcmHr [email protected]
which also required adding:
PermitUserEnvironment yes
to the /etc/ssh/sshd_config
file.
That works, but I'd rather learn about a user.name=ASK
setting if such a thing existed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With