How to host your project to GitHub

Source: Internet
Author: User

First step: Register a GitHub account first, which is required

Registered Address: GitHub website Registration Portal

Step two: Prepare for work

The GitHub Web site uses git versioning tools to manage warehouses, noting that they are not equivalent.

GitHub is the world's largest repository of third-party open source repositories, and Git is a distributed version Management control tool (in addition to git, there are other versioning control tools such as SVN).

Basic introduction to Git and basic use here will not do more introduction, if necessary, please refer to: Git tutorial.

Related books about git usage:git Versioning (2nd edition) | git authoritative Guide ( electronic version )

The introduction and instructions for GitHub can be found in the book GitHub Primer and Practice (some of the content is not available in the electronic version of the download) or directly through the official website of the help page to view.

Step three: Build an empty warehouse on GitHub (repositories)

We assume that you already have a GitHub account and that you are logged in successfully, then you will be able to find an interface like the one below.

  

The following is a brief description:

The 1th area will display your personal information, such as nicknames, Avatars, contact details, etc.

The 2nd area shows some of the relevant third-party libraries.

The 3rd area shows your activity on the GitHub website, which is represented by a variety of squares, one of which represents one day (life is plainly a little more than 30,000 small squares, and there are a few useless things to be counted here), the darker the color, the higher the activity.

The 4th area can do some configuration operation and so on.

After seeing this interface, click on the arrow to refer to the +, select the new repositories option will jump to the following interface, simple configuration can create an empty warehouse.

  

In the use of red line in the place to be aware of, in the creation of the warehouse needs to be simple configuration of the warehouse, such as the warehouse name and so on.

Where repositories name needs to be filled in is the name of the warehouse.

  Description (optional) to fill out a simple description of the warehouse, mainly to introduce the functions of the warehouse (of course, if the lazy can not write).

The next two options (public|private) indicate whether the warehouse you are creating is public or private. What is the difference between public and private? If the warehouse is public then it means that anyone can unconditionally get the content of your entire warehouse, free of charge. If the warehouse is private, then others cannot access your private warehouse, the condition is to pay the protection fee, protection fee is not expensive monthly 7$ only. Here I only do demo select Public Warehouse can.

Initialize this repository with a readme indicates whether a Readme file is generated when the repository is initialized. When we look at other people's framework, we will have a description of the framework version information, how to use it, and so on, which is the Readme file, which is selected on the page.

Add. Gitignore button, a drop-down box appears and asks if you want to set the Ignore file for the repository. This depends on your own needs, usually if your warehouse and code project is related, it is best to choose the appropriate ignore files (such as OC Project can choose Object-c,swift Project can choose Swift), as for why please refer to the basic use of git.

ADD a license button, the click will appear a drop-down box, you need to choose an open source protocol, open source agreement there are many kinds of use of more than MIT or Apache, different open source agreement on the use of the project and other different provisions, details can refer to choose an open SOURCE License.

Once the above information is set up, then just click the Create Respository button to create an empty warehouse.

Fourth Step: Understanding the main warehouse interface

At this point, an empty warehouse has been created and you will see the following interface.

  

Here is a brief introduction to the warehouse page information.

The 1th area is the name of the warehouse, which can be found by searching the warehouse name after you create the warehouse.

The 2nd area is a warehouse-related information, such as the Code option lists the contents of the warehouse (file), the issues option lists other people's questions about the warehouse, and the Pull request option provides a portal for other developers to request a merge when maintaining the warehouse. The setting option lists some operations that can be performed on the warehouse, such as deletions, and so on.

The 3rd area lists the number of times the warehouse was submitted, the tag version, and so on.

The 4th area lists the contents of the warehouse, and there are only three files in the current warehouse, respectively. Gitignore ignores files, license open source protocols, and initializes the generated readme files. There is a clone or download button in the upper right corner of the area, click the Download Zip button to download the repository locally.

The 5th area shows the contents of the Readme.md file.

The 6th area lists how many people are concerned about the warehouse, the popularity of the warehouse, and the number of times it was forked. We see whether a framework is popular by looking at the number of star in the warehouse and the number of times it is forked.

The above is a simple introduction to GitHub automatically generated a blank warehouse, with this blank warehouse before we can do the following.

Fifth step: Connect to the remote repository

There are many ways to connect to a remote repository, you can use a third-party git management graphical interface tool such as Sourcetree, or you can use a terminal (command line), or Xcode. Here, you choose to use Xcode to do the work.

Open the Mac above Xcode and open the upper left corner menu and select the Xcode->preference option as shown in:

  

Go to the Configuration information window for Xcode.

      

To switch to the Accounts menu, click the + sign in the lower left corner and select Add Respository. The following interface appears and needs to be configured.

    

Address needs to enter the remote warehouse addresses to connect, in fact, there are two ways to connect to the remote warehouse can choose one is HTTPS request, one is SSH key pair. Here, we first explain how HTTPS requests should be handled, how to obtain the warehouse address? Select clone with HTTPS after copying the address in the output box as shown in:

  

Type: means that you can choose Git and svn in the version management mode you use, only git (because GitHub only supports GIT management)

Authentication: means authentication is authenticated, GitHub provides two authentication methods, HTTPS and SSH, we are currently choosing HTTPS, so here we choose User Name and Password.

User name and password two are populated with the username and password of the GitHub website login.

After the configuration is complete, click the Add button and the following window appears, indicating that the connection to the warehouse was successful.

  

Sixth step: Download the remote repository to the local

  After connecting to the remote repository, we then download the remote repository locally and select the source Control->check out of the menu bar.

  

The following screen will pop up to find the repository to download (usually at the end), click Next

  

After clicking on the Next button, you will need to select the storage location after the repository is downloaded and click Finsh to finish. Once the repository has been downloaded, you can find a. git hidden file, the Git repository, inside.

Add: You can enter the following command in the terminal to display or not show hidden files

# Show hidden files $ defaults write Com.apple.finder appleshowallfiles Yes && killall Finder

# do not show hidden files $ defaults write Com.apple.finder appleshowallfiles no && killall finder

  

Seventh step: Add OC Items to the repository and push to the remote server

1) First create a new project, assuming that test, the project is created after saving to the warehouse path (and. git file sibling) as

  

2) Open the project, you will find in the project's navigation bar each file will show different status as? M et cetera, by initializing the project in this way, the project itself has been incorporated into the management of the Git repository.

  

3) Submit the changes locally and push to the remote server.

Xcode itself is well integrated with Git, and clicking on the Source Control option above the menu bar can see the following view:

  

Where check out is equivalent to the clone directive in the git command line to download the remote repository locally.

Commit is equivalent to the commit instruction (no difference) in the git command line to commit the changes to the local git repository.

Push is equivalent to the push instruction (no difference) in the git command line, which is used to commit the changes to the remote Git repository.

The pull instruction is equivalent to the fetch instruction (no difference) in the git command line to get the latest remote repository information.

Here, we need to select the Commit option first to commit the changes to the local repository. After selecting Commit, the following interface appears:

  

Where the 1th region represents the content to be submitted, the 2nd region input the description of the submission (note), the 3rd area can be selected on the tick, if it is ticked, then when the bottom right button is clicked, all the changes will be submitted to the local Git repository, and then push the changes to the remote Git repository.

After you click Submit, you can refresh the home page of the repository on GitHub, which shows a new update, and the project submission is complete. Click to view the project file as shown in.

Original address: http://www.cnblogs.com/wendingding/p/5584310.html

How to host your project to GitHub

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.