Before starting, I suppose that you have already downloaded GPG, if you haven't check part 1 of the blog….
1. Download git for Windows system:
- Download the latest version of git.
- Run the downloaded installation file.
- Follow the instructions, and keep the default options unless you need something else. When you reach the page (shown below) choose the editor you are familiar with.
4. After installation, you will notice that there are multiple icons for git (Git bash, Git cmd, Git GUI) to know the differences.
5. Now, git should know you to work properly, HOW?? by configuring your name and email. To do this open Git bash, and run the following commands:
git config --global user.name "Enter your Name"git config --global user.email "Enter your email"
Note: make sure you enter the email of your GitHub account (if you want to use GitHub as the online host for your codes).
6. This step is only for GPG2 users. Git use GPG by default for the signing keys, to let it use GPG2 instead, run the following in Git bash:
git config --global gpg.program gpg2
7. As I discussed in the previous blog, that your name/email is not enough, and GPG key is required. To get the GPG key run the following command in the terminal (NOT Git bash): Write gpg2 instead of gpg, if you use GPG2
gpg --list-secret-keys --keyid-format LONG
This is what you’ll get:
The Short Key (shown above) is the GPG key ID, that will be used as a signing key in git, so copy that key, and run the following in Git bash:
git config user.signingkey YOUR-KEY-ID
You can use the below command instead, if you want to use the same signing key for all of your projects.
git config --global user.signingkey YOUR-KEY-ID
Now you’re ready to use the amazing features of git, Hurraaaaaay 😄
2. Download git for Linux and mac OS:
Git might be pre-installed, check the version to know
if it’s found, scroll down to the (configuration step).
** In Linux **
- For Debian based systems: First, start by updating the Advanced Package Tool (apt)
sudo apt updatesudo apt install git
- For rpm based systems:
sudo yum install git
** In mac **
brew install git
configuration step :
After installing git, you should identify yourself to git, by setting your name, email and signing key, to do this go back to the (Downloading git for Windows) and start from step 5. Here all the commands will be run in the terminal, unlike Windows.
To know other ways for downloading git, check 👉 atlassian-install-git