How to create a new project on GitHub with the command line

Source: Internet
Author: User
Tags git clone

Preface: New GitHub account and Git basics those are the default readers and have already added their computer's SSH key to GitHub, here's how to create a new project on GitHub. This article refers to this article

Getting Started with Git basics

There are 2 types of new projects:
1. The code starts from scratch.
2. The project code already exists in the local area, just want to open source or store it on GitHub.

In either case, however, you'll have to create a new warehouse for your project on GitHub. After logging in to GitHub, find the tab in the repositories below and click New in the Red box to create a new project repository.
Interface

The interface for creating a new project warehouse is as follows:
Interface for new project warehouses

Then enter the name of your project, the description of the project, and choose whether the project is public or private.

Initialize this repository with a README

This option is asking if you want to help you initialize a project based on the name and description of the item you entered (Generate a readme MD file)

The next step is to ask if you want to add a project's Ignore file (. gitigore) and if you want to increase the license (license) for your project.

The above, according to your own actual need to fill out and select, and then click the Green button will create a project warehouse.

Then you will be redirected to a homepage of your project. the code starts from scratch

You can create a blank folder locally, then clone the project you just created (the Ps:clone URL can be found at the bottom right of the project home page), and then add the code to upload it.

mkdir emptyfolder
cd emptyfodler
git clone https://github.com/youraccount/yourproject.git

And then the rest is git add and git push things. code already exists locally

Execute the command git init in your project file directory to make it a git repository.

Add all the files in the project to the local repository, using the following command:

  git Add.  Note There is also a small dot
  git commit-m "some message for this project."

Then pull down the project on GitHub (this step can be omitted)

  Git pull Https://github.com/youraccount/yourproject.git

Add a remote repository named origin for the repository.

  Git remote add Origin https://github.com/youraccount/yourproject.git

Executes the push command to initialize the GitHub repository. Note the-u parameter in the command line, which automatically establishes a trace of the local branch and remote repository branch after the push succeeds

  Git push-u Origin Master

PS: The link in the article and the content if it is infringed please let me know, I will delete. If there are errors or omissions in this article, please correct me. Thank you. :P

Author: mcat
Link: http://www.jianshu.com/p/df7ce9f3a5cb
Source: Jane book
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.