How to host open-source code libraries on Github

Source: Internet
Author: User

How to host open-source code libraries on Github

Hello everyone, today we will learn how to host open source software source code in the repository provided by github.com. GitHub is a web-based Git repository hosting service that provides git-based distributed version control and source code management (SCM) Functions and adds its own features. It provides a collaborative workspace, code preview, and code management function for open-source and private projects. Unlike Git, which is a complete command line tool, GitHub provides a web-based graphical interface and desktop, and integrates mobile operations. GitHub also provides a private library payment plan and a free account that is commonly used to manage open-source software projects.

This is a fast and flexible web-based hosting service. It is easy to use and manage distributed version control systems. Anyone can host their software source code on github, it allows millions of people around the world to use it, participate in contribution, share it, track problems, and use more. Here are some simple and quick ways to host the software source code.

 

1. Create a New Github account

First, open your favorite browser and visit github. The home page is shown below.

Now, after the homepage is opened, enter a new github account for registration.

After entering the valid information required for registration, you will be transferred to the Plan Selection step. There are five plans on this page. We can choose as needed. Here we want to choose a free plan. Therefore, click Select Free plan and complete registration. If we plan to create an organizational unit, we need to check "Help me setup an organization next ".

 

2. Create a new database

After successfully registering a new account or logging on to Github, we need to create a new library to start our journey.

Click the (+) button next to the right account id on the top, and then click "New Repository ".

After clicking create a new database, we enter the page for entering the required information.

After entering the information, click the "Create repository" button in green.

After completing these steps, we will see a page similar to the figure below.

 

3. upload an existing project

If we want to share our project on Github, we naturally need to push the code to the library we created. To do this, we should first install git on our Linux machine. If I am running Ubuntu 14.04 LTS on the machine, I need to run the apt tool to install it.

  1. $ sudo apt-get install git

Now that git is ready, we have to upload the code.

Note: To avoid errors, do not include files such as README, license, or gitignore in the new initialized library. You can add them after the project is pushed to Github.

On the terminal, we need to switch the current working directory to the directory of your local project, and then initialize it as a Git library.

  1. $ git init

Next, we add files in the new local library as our first submitted content.

  1. $ git add .

Now we will submit the files we have added in the local database.

  1. $ git commit -m 'First commit'

On the terminal, add the URL of the remote database so that our local database can be pushed to the remote database.

  1. $ Git remote add origin remote library URL
  2. $ git remote -v

Note: Make sure that the above "remote library URL" is replaced with your own remote library URL.

To push changes to our local repository to the GitHub repository, run the following command and enter the username and password.

  1. $ git push origin master

 

Clone a database

If we want to use a simple command to download the code library from github to the local machine, we can use the git clone command, which will clone the latest directory from the remote library.

  1. $ git clone https://github.com/aruntechgeek/linspeed.git

Change the URL above to the address you want to clone.

 

Push changes

If we make changes to our code and want to push them to our remote library, we should run the following command in this directory.

  1. $ git add .
  2. $ git commit -m "Updating"
  3. $ git push

 

Conclusion

Aha! We have successfully managed the source code of our project to the Github library. Github is a fast and flexible web-based hosting service. It is easy to use a distributed version control system. Millions of great open-source projects are deployed on github. Therefore, if you have any questions, suggestions or feedback, please let us know in the comments. Thank you! Enjoy it :-)

GitHub Tutorials:

Create a personal technical blog via GitHub

GitHub tutorials

Git tag management details

Git branch management

Git remote repository details

Git local Repository (Repository) Details

Git server setup and Client installation

Git Overview

Share practical GitHub tutorials

GitHub details: click here
GitHub: click here

This article permanently updates the link address:

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.