kefimochi / sync-contribution-graph

Generates empty commits to match contributions from other public GitHub accounts.
MIT License
222 stars 14 forks source link

Config Emails! #6

Open JeremyRoussel opened 2 years ago

JeremyRoussel commented 2 years ago

You may want to mention in the readme that if you do not use the same email for both accounts, that they will need to check their global .gitconfig and/or set up a local .gitconfig to ensure that the user.email setting matches the account they want to have credit for the commits. The user.email flag is used to identify the 'user' that made the commit, regardless of what key was used to upload the history.

kefimochi commented 2 years ago

If you look at the code this script never actually touches any of the commits and doesn’t have access to any vulnerable information. It only works with publicly available html of GitHub contribution graphs 😄

kefimochi commented 2 years ago

If this is regarding a concern that anyone could imitate commits from any public GitHub account, here’s my Twitter response 😊 https://twitter.com/kefimochi/status/1470467623800377346?s=21

JeremyRoussel commented 2 years ago

I did take a look at the code trying to fix my own issues, it's very nice! I have two git accounts that are linked to different emails, a work and a personal. My default .gitconfig (global) setting for user.email is my work email. To make the commit sync work, I needed to change the local user.email .gitconfig setting on the repository to be my personal email. If I didn't do this, when trying to sync the contributions the default 'work' account was the one that GitHub thinks is making the commits! I did figure out why my 'work' account was making commits on my 'personal' repo, but it might help to add a note about this to the README for anyone else who comes across this issue. It just requires changing the user.email setting locally to ensure your personal account gets credit!

kefimochi commented 2 years ago

Ohh I get it now! I am too afraid to do personal development on work machine in case company can claim ownership so never ran into this problem. Will figure out how to help, thanks for bringing it up! 👏