How to download or install Git

How to download or install Git

Download Git for Windows

Step 1: Goto the official Git website:

Step 2: Click the download link for Windows and allow the download to complete.

Step 3: After downloading the file successfully, goto its location and extract the File & now you will see the Git file (Installer). Double click on it and start the installation & complete as per your need.

Step 4: Now your Git is installed successfully. Press your Windows Key button and search Git Bash and check the git is installed or not on your machine.

Step 5: Check your Git Version: 

$   git --version

Step 6: Now you configure your git credentials to get started with your github or gitlab or bitbucket etc..

1. get all the branches : $ git fetch --all

1. Check in which brnanch you are and how many branches are there :

    $ git branch

    $ git branch --all

2. Check to current branch : $ git branch --show-current

3. Check your current repository name :

    $ git remote -v

4. Check your current repository full detailed status (Username & password will be asked):

    $ git remote show origin

5. How to add Git or Re-initialise Git :

    $ git init

6. If you want to change the repository from one to another :

    $ git remote add origin and_your_repo_path

    Eg: Your_Repository_Path:

Create a branch :

    $ git checkout -b <name-of-branch>

Switching from 1 branch to another branch

    for master: $ git checkout master

    for other-branch: $ git checkout <name-of-branch>

7. Create a branch in your repository and pushing to GitLab:

    $ git checkout -b <name-of-branch>

    Now $ git add .

    Now $ git commit -m "First Commit"

    Now $ git push origin <master> or <your_branch_name>

7. if you want to push the file to your repository:

    $ git push origin <master> OR <your_branch_name>

8. How to clone a repository -

    via HTTPS: $ git clone

    via SSH: git clone

9. How to clone a branch

    $ git clone -b <branch> <remote_repo>

10. How to remove or delete branch from your repository

git push origin --delete <master> or <your_branch_name>

© Copyright - 2018 - 2021 | All rights reserved at Funda of Web IT