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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
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
andproject2
.project1
directory:Once you are ready with
project1
use thecd
command to access theproject2
repository and run the config command again.Hope that this helps. Regards, Bobby