I’ve been made the collaborator(say, i’m User 1) of a git repository. Currently due to some settings which I must have wrongly done unknowingly, all commits are being committed as if being done by the owner(another user – say user 2) who has shared the access with me.
I guess while doing a git clone of the rep. I had done something wrong.
How can I get myself as the owner of each commit?
What do I need to change?. I’m just currently aware of a .git/config file .
What precautions do I need to take to avoid this in the future.
Thank you very much..
You need to configure your:
in order to be able to push directly your commits to the repo where you are now a collaborator. See GitHub help.
The email must be the one used with your GitHub account.
You could also, through a filter-branch, reset the author name and email of your previous commits, and force a push (but that will rewrite history, so you need to make sure that won’t bother anyone else who would have already clone the repo).