GIT Tutorial In Details

GIT Commands

  1. git init
  2. git add README.md
  3. git commit -m "first commit"
  4. git branch -M main
  5. git remote add origin https://github.com/<Your Git User Name>/<Git Reposiroty Name>.git
  6. git push -u origin main

Create Github repository

  1. Go to GitHub in a web browser on computer/mobile/tablet any device to join GitHub.
  2. You need to enter few details on GitHub to create account such as EmailId, Name, Password etc...
  3. By using the same credentials you can login.
  4. Create repository. Click on the right side top corner arrow down icon then click on "Your repository" link.

  5. How to create repository in GitHub

  6. Click on "New" botton and create your repository.

  7. How to create repository in GitHub

Add Files in GitHub repository using browser/without GIT installation

If you don't want to install GIT on your local machine, you can directly add your files in GitHub repository without having GIT installation. Check the below steps of how to add files without GIT installation. If you want to add your files using GIT commands on command prompt then you can refer the below sections, you may skip this section.

  1. Go to the GitHub.com. Click on the right side top corner arrow down icon then click on "Your repository" link.

  2. How to create repository in GitHub

  3. Click on your repository name then page will be redirected to another page.
  4. Click on "Uploading an exiting file" link.

  5. How to create repository in GitHub

  6. You can drag your files in drag section or click on "Chose your files" if you want to select files from directory.
  7. Add your commit message in the commit message box.
  8. Click on "Commit Changes" botton.

  9. Upload Files in Github in browser without git installation-browse.PNG

Install GIT on Windows

If you want to add/update code using GIT commands, you need to install GIT on your local machine and need to configure.
If you want to add your files directly to GitHub repository using browser then you may skip this section , refere the above section(Step - 3).

  1. Go to the GIT Download URL and download.
  2. Execute the downloaded .exe file or double click to install.
  3. Choose default options and click on next button every time until finish the installation.

Configure SSH Key in GitHUb

You need to configure SSH key in GitHub.com from your local machine.
If you want to add your files directly to GitHub repository using browser without GIT installation then you may skip this section, refere the section - 2 only.

  1. Go To any folder in your local machine and right click. You will see the two options GIT Gui Here and the second option is Git Bash Here.
  2. Click on "Git Gui Here" option.

  3. Git Base

  4. Click on "Help" option on the top side of Git Gui.

  5. Help option in Git Gui

  6. Click on "Show SSH Key" option under help option.
  7. Copy the SSH Key or click on "Copy to Clipboard" option to copy the SSH key.


  8. SSH Key Setup

  9. Go to the GitHub.com and click on "Setting" under top right arraw down key.

  10. SSH Key Setup on GitHub

  11. Click on "SSH and GPG Keys" link on the left side of page.

  12. SSH Key Setup on GitHub

  13. Click on "New SSH Key" botton on the top right side of page.

  14. New SSH Key Botton

  15. Write title in the title box. You can give any name.
  16. Paste the SSH Key in the Key box. SSH Key you have copied from "Git Gui Here", if not you can copy again from "Git Gui Here"(Refer point 5 in this section).

  17. New SSH Key Botton

  18. Click on "Add SSH Key" botton on the down side of the page.

Code Push to The GitHub Repository on Command Prompt Using GIT Commands

If you want to add your files directly to GitHub repository using browser then you may skip this section and refere the above section(Step-3).

  1. First you need pull/fetch the repository in side a folder then need to do the below steps.
  2. Go to any folder and right click. You will see the two options here one is Git Gui Here and second one is Git Base Here.
  3. Click on "Git Base Here". You will see the GIT command prompt.
  4. Go to the GitHub.com and copy the SSH Remote URL.
  5. Click on the right side top corner arrow down icon then click on "Your repository" link.


  6. How to create repository in GitHub

  7. Click on your repository name that you have created.
  8. Click on "Code" botton/link.
  9. Click on "SSH" link.
  10. Copy the SSH Remote URL from text box.

  11. How to create repository in GitHub

  12. Execute git init command on Git Base Here. See the below image for the understanding.
  13. Execute git remote add origin {paste the copied remote url} command on Git Base Here. See the below image for the understanding.
  14. Execute git fetch command on Git Base Here. See the below image for the understanding.
  15. Execute git clone {paste the copied remote url} command on Git Base Here. See the below image for the understanding.

  16. How to create repository in GitHub

GIT Commands

  1. git init
  2. git add README.md
  3. git commit -m "first commit"
  4. git branch -M main
  5. git remote add origin https://github.com/<Your Git User Name>/<Git Reposiroty Name>.git
  6. git push -u origin main