Developer
As I was following the tutorial https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-20-04 I wanted to know, how can we configure multiple usernames? Reason: Say one project is personal and requires myemail@gmail.com and other one is professional and requires myemail@company.com. How can I achieve the same?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there @yashtibrewal,
In order to set up your Git username for a single repository, you need to skip the --global flag and run the command inside the specific repository.
Let’s have the following example if you have 2 repositories: project1 and project2.
project1 directory:cd project1
git config user.name "Your Name"
git config user.name
git config user.email "your_mail@example.com"
Once you are ready with project1 use the cd command to access the project2 repository and run the config command again.
Hope that this helps. Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.