I frequently commit code to a repository at work using git from several devices (desktop PC, laptop, etc.). The desktop PC (in-office) automatically configured my identity when I pulled that repository. However, I have used my laptop for personal projects before and have globally configured my user.name and user.email to different values. When I commit code to the work repo from my laptop, the commit's author is different from when I commit from the desktop PC.
I want to sync the identity from my desktop PC to my laptop, that is, to make sure the author remains the same. Is setting user.name and user.email enough? Does git determine a commit's author using other means?