Installing Git on Windows –
1 . To install Git, first go to this website – https://git-scm.com/downloads
And click on Download for windows.
2 . Next click on ‘click here to download.’
3 . Next click on the .exe file to start the installation.
4. In the select component make sure Windows Explorer integration, Git bash here and Git GUI here all are checked.
5 . In Choosing the default editor used by Git. Select Use Visual Studio code as Git’s default editor.
6. Then keep click Next Next Next to install Git.
7 . Next Open Git Bash or command line (cmd) and type the following command to make sure git is installed properly.
You will see something like this.
Create a GitHub Account –
Next you need to create a Github account.
1 . Go to https://github.com/
Here type you email address and sign up for GitHub.
2 . Next walk through the setup wizard and choose your username and password. Once finished creating an account. Go to the next step.
Setting up Personal Access Token –
GitHub requires you to setup a special Access Token If you want to authenticate yourself using a command Line.
1 . Sign in to https://github.com/ using your username and password. Click on your profile icon in the top right corner and Go to Setting.
2. Next Go to Developer Settings in the left hand menu and click on that.
3. On the next screen click on Personal access token. This will help you create a token that you can use to authenticate with Github using a terminal.
4. Click On Generate New Token at the top right corner.
5. Next you need to write a Note that serves as a reminder as why you created this. And Set an expiry date. Let’s select 90 days. Finally be sure to check repo box to give this token “Full control of private repositories”
6. Next click on Generate token at the end. Github will show you a final screen that reveal the token. Copy that access token and keep it somewhere secure – this gives access to you or any other person to your GitHub account.
Configure Git –
Next you need to set your username and email address. Git uses these information whenever you use it. You only need to do this once.
Type the following code to set your username and email. Please specify your GitHub’s username and email.
git config --global user.name "brad" git config --global user.email firstname.lastname@example.org
Check Your Settings –
To check your settings type
git config --list
This will list out all the settings that has been done so far.
To check username in git type
git config user.name
And to check email address type
git config user.email
Getting Help –
To get help with any command in git, you can type
git help <command> git <command> --help
Let’s say you want help with git config command. For this you will type
git config --help