How to clone GitHub Project on local computer using Git BASH

As web developer I learn using Internet a lot, and for developed project need or public project storage I always use GitHub and love it.
Some time I satisfied after watched codes and it makes me happy if I got my solution quickly. But everything not be hassle, complication in development still having their own place.
My almost search ends with GitHub and lot's of public projects provide me everything.
There is two way to get project from GitHub:

1- Direct .zip Download from URL, extract in directory and then run.
2- Make a clone and run directly in your browser (depends upon cloning)

Direct download and extract in a folder to run as you need, but cloning is command line method and if you are beginner it's good habit to use command line. So I'm going to share a method by using you can make clone of any public git hub project and run locally on your computer.

copy github project using cmd gitbash

How to clone GitHub Projects on local computer:

  1. Download Git Bash from https://msysgit.github.io/ (for Windows) and install as normal software installation.
  2. After installation run click on Git Bash icon from start menu.
  3. A command line will appear, how to set path for your project directory,
    (Ex- my project location is c->xampp->htdocs)

type cd c: to select c drive and hit enter. (cd means current directory)

cd c:

type cd xampp and hit enter (change directory as per your need it's only example)

cd xampp

Type cd htdocs

cd htdocs

Now we will learn cloning procedure of GitHub project in this directory.

Goto GitHub and copy your required public project clone URL as below image:

git bash clone public project
Come back to Git Bash and paste as below:

git clone {COPY_URL} {Directory_Name} and hit enter, wait for some time requested GitHub project will be clone.
When cloning finished, just goto folder and you can find everything of online project.

git clone https://gist.github.com/96419d92bb08c984d55c.git tricksway

How to paste URL in Command Line ?

No worry sometime a small things makes problem for you and at time you need to concentrate and check what you are missing, if you can't find way to paste URL in command line just follow below image:

how to paste github clone url for copy project

Your project directory looks like below image:

 clone github project

Note: Cloning of GitHub project in this method only valid for public mode projects.

Thanks for reading this article let me know if you are facing any problem I will surly help you.

Himanshu is a young engineer living in India. Currently working at Cognizant as a Senior Engineer. He is an ethical hacker & blogger too, doing lots of crazy stuff... If you seem interesting, go through his portfolio: www.himstar.info : "Open Source. Millions of open minds can't be wrong!

Leave a reply:

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Site Footer

Sliding Sidebar

We are India’s largest Startup Community


We are team of ' Delhi Startups ' , most active startup community with strict spam policy.
We are making !deas happen..for future, business and jobs without charging anything, with connecting entrepreneurs.. It's a reason to trust on us.
Come and join or subscribe, we will defiantly give a reason to like us.

Our Facebook Page