Setup or upload your local project to GitHub using command line

GitHub is very useful for developers to share or backup of your project. You can live your project by making a repository on GitHub and share among to multiple developers. It also facilities to see any changes and also can see who is changing in your project. You will notify by mail if any changes is done in your project and who has changed. It is useful to take backup of your project on regular basis without using space of your server.

GitHub provides both interface GUI and CLI. In this article we will use command line interface to upload local your project and for making changes. Firstly we create account on GitHub after that we make small project on local and will upload on GitHub. These are following steps to set up your project on GitHub as follows:

1. Go to https://github.com/. Click on Sign up button and fill your required details and click on Create an account button.

2. Choose your plan according to your need. For starting I would recommend unlimited public repository for free which is default option  and click on continue button as shown below:

3. After clicking continue button you can skip next option then will have following screen as shown below. Click on Start a project button it will say for verify email address. Verify your email address and start to make repository.

4. When you click on start project button will have following screen as shown below. Click on create repository button then it will redirect you quick setup page will see in next step.

5. After clicking on create repository button will have the following screen with various command which we use in cmd or command prompt to upload project on GitHub.

6. To run commands of git on command prompt we have to install git on your local system or computer and set it into window environment variables. You can download git from https://git-scm.com/download. By default it will install in your program files of c drive and set this path in environment variables as shown below. Here we are showing that how you can set path in environment variables:

  • Right-click "My Computer",
  • Select "Properties",
  • Open "Advanced",
  • Click "Environment Variables",
  • Highlight the "Path" variable,
  • Click "Edit",
  • Add your specific path to front of "Variable value" field, separated by a semicolon from the existing entry. Do not add a space between ; and last entry

Like path - C:\Program Files\Git;  

We are attaching here image for your better understanding and can do this thing by seeing this image:

7. Now let's make new project with one html file on local machine which will be uploaded on GitHub Repository. In my case project name is discussdesk which contains one file called demo.html with dummy content as shown below:

8. After setting path variable close your cmd or command prompt and open again. Run following command one after one as shown below. One thing to remember here you should be in working directory or folder which you want to upload or live in GitHub. In my case folder name is discussdesk and it is located in htdocs folder of xampp.

Now you will refresh your Github repository or folder you will get your all local files and folder on GitHubRepostory as shown below.

Share this Article on Social Media

All of my Scripts are ready to customized as per your requirement. Feel free to contact for script customization.

Contact me at discussdesk@gmail.com

"Note : It will be charged as per your customization requirement :)"

Get Updates, Scripts & Other Tutorials to Directly to your Email

Over 20000+ Happy Readers already subscribed. (We don't send spam email). Every email subscriber can get our latest updates and download our 100+ scripts.

Comments