I am working on a project from two different computers. I am using Git(hub). Should the name and email address be set the same for Git on both computers? I am guessing yes, as I am one person, though it may make it harder to track changes if something gets messed up on one of them. If relevant, I am the only person working on this project and using PyCharm.
-
if the email changed that will reflect in commit in github hence it will look like 2 different person are commiting, and if the email id is same then it does not matter from x no of system u commit the code – KOTIOS Apr 14 '17 at 08:53
-
@MyMasterPeice sorry I don't understand. This is the first commit from new installation so there wouldn't be a change. I'm wondering which approach is best? – northerner Apr 14 '17 at 08:57
-
i basically mean you can use any name and email which can be different from ur github account using using git config command but just keep email and username same in different systems used if any – KOTIOS Apr 14 '17 at 08:59
1 Answers
I had the same situation as yours,I also commit code from different systems on my personal git repo, on which only i work.
But i keep the same git username/email on both the system for same git repo, avoiding that results in the different username in git commit history and confuses me. Also git has a very good disaster recovery system so you should not worry about messing up things on a particular system.You can always overcome to it.
However i do have different config for different git repo on a system, suppose if i am working on my official repo and there my github handle is different, then i don't want to use my personal username there.you can setup git username/email both locally and globally in your system.
Please follow this SO post, on how to setup local and global git username/email.
Hope i answered your question, let me know if you need some explanation.