Whether starting a solo project or working with someone else you got to have your things right.
Name and Email:
The first step to configure Git is to configure your user name and email. We can do so by typing the following lines
git config --global user.name "My Name"
git config --global user.email "My Email"
SSH key
go to ssh folder on your computer and create a new one
cd ~/.ssh
ssh-keygen -t ed25519 -C "My email"
you'll be asked many questions that you should read first but you can ignore those and just press enter for everyone.
now run the following command:
cat ./id_ed25519.pub
now you can get your public key and use it on Github/Gitlab/GitBucket. I'll be showing you how to do it on Github.
Now use the public key we got before.
Every time you feel needed to edit your .gitconfig
you can do so by running the following line on your terminal.
git config --global --edit
Cool stuff
There is a lot of cool stuff we can configure on Git but I'll list some of them here and leave them for a new article.
Configuring the initial branch
git config --global init.defaultBranch master
Configuring signature with GPG/SSH key
Link: Docs
Top comments (0)