Sometimes you may work on multiple projects using multiple git users. Your personal project with your personal GitHub and office GitHub with your business email. You may need to commit like someone else 🤫. There are two options to change git author of your repository.
- Go to your repo folder &
show hidden folders
- Go to
.githidden folder and open
- Add/replace the following block in the config file
[user] name = deshan email = deshan [at] dev.to
Now you can commit a new change and check author information.
Open the terminal and go to the repository. Enter the following command
git config user.email "email@example.com" git config user.name "deshan"
If you want to change the author for previous commits, follow this replace-accidentally-committed-git-author-information-from-git-history