-
Hi, we would like to be able to make git commits from a machine that is shared among many users in our lab (iCub laptop). Each user has a personal GitHub account. For example, today I'd like to make a commit "signed by me", tomorrow a colleague would make another by him, etc., and all of this would happen on the single clone of the repository that exists on the machine. We thought about changing the global file In the icub-main history, I noticed that sometimes the phrase "committed with" appears, like shown below. Perhaps that's what we'd like to achieve. |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
Hi, for example https://stackoverflow.com/questions/18750808/difference-between-author-and-committer-in-git and https://git-scm.com/docs/git-commit (scroll to --author). Best, Tobias |
Beta Was this translation helpful? Give feedback.
-
If you are using different repositories you can also set the name and email in just for a specific repository, but it's not a very clean solution, and I don't know if it is the case here. You can use Another option is to use the environment variables:
"Committer" is the "iCub User" in the picture you added. |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot. I applied the suggestions and also created Bash aliases to avoid typing the
|
Beta Was this translation helpful? Give feedback.
-
@drdanz do you know what will happen for a commit where |
Beta Was this translation helpful? Give feedback.
-
Uhm ... it seems that somehow the information conveyed by the https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user |
Beta Was this translation helpful? Give feedback.
-
I've noticed now that the alias does contain the |
Beta Was this translation helpful? Give feedback.
-
@pattacini i can confirm that github uses the author email to associate a commit to one user, or the author name if the email does not correspond to any user. |
Beta Was this translation helpful? Give feedback.
-
Closing this, @gsaponaro please reopen the issue if you need more information. |
Beta Was this translation helpful? Give feedback.
-
Perfect, thanks. |
Beta Was this translation helpful? Give feedback.
If you are using different repositories you can also set the name and email in just for a specific repository, but it's not a very clean solution, and I don't know if it is the case here.
You can use
git commit --author="John Doe <john.doe@example.com>"
to change the author when you make a commit.Another option is to use the environment variables:
"Committer" is the "iCub User" in the picture you added.