Analysis of uploading Android project to GitHub

This is a new series of articles, GitHub project, which mainly explains their own GitHub project open source practice, GitHub project analysis, etc.

This article mainly explains how to upload your Android projects to GitHub. I believe you will often visit GitHub to see if there are open-source projects with similar requirements in order to avoid repeated wheel building in the development process. Then how do the open-source projects on GitHub upload to GitHub? With this question, we begin our explanation today.

First, if you need to upload a GitHub project, you must have a GitHub account, which is usually registered by e-mail. Here, it is assumed that everyone already has a GitHub account. If not, register first. Registration address: https://www.github.com (PS: if anyone doesn't have a GitHub account these days, it's really hard to say that he is a programmer...)

1、 Create a warehouse on GitHub

1. Open the GitHub home page, log in, select Repositories on the personal home page, and click new to create a personal code warehouse;

Start editing the warehouse information and click Create repository to create our code warehouse;

2、 Create Android project

*Here is to create a common installation project. The name of the project is HelloWorld, which is consistent with the name of the code warehouse we created.

3、 Create a local git repository

*There are still many git tools. I need to download a git client. I use a local git for windows 2.6 client here. I don't know where to download children's shoes. Click here to download them: http://xiazai.jb51.net/201805/yuanma/Git-2.6.0-64-bit (jb51.net).rar

After downloading the GIT client, open the command window, enter a local code base, and clone the HelloWorld project we created on GitHub,

As shown in the figure:

Enter the downloaded HelloWorld project path and copy the source files in the HelloWorld project we created to the HelloWorld directory under clone,

As shown in the figure:

It should be noted here that the. Gradle folder and. Idea folder do not need to be copied when they have the app.iml file under the app folder.

At this time, I enter the project directory. Here is the HelloWorld project under the workspace directory on disk D.

Here you can configure the mailbox and user name, so that you can indicate who submitted it

Because I have logged in with GitHub for windows, I won't show the command screenshot here.

Enter the following command to add a file to version control:

Note that the space after add must be added, otherwise an error will be reported.

After adding, execute the submit command

This commits the changes to the local repository

Upload local warehouse content to GitHub

Until the command is executed, the above prompt appears, indicating that the submission is completed.

Finally, you can see that hello world has been uploaded on our GitHub homepage:

Finally, let's list the GIT commands used in the whole process:

As a good habit, we need to explain the main functions and usage of this project in readme.md.

Summary:

This article mainly explains how to upload Android projects to GitHub, which is the basis for us to explain the GitHub project in the future. After understanding these, we can upload our open source projects to GitHub. O (∩ ∩) O ha ~, everything is difficult at the beginning. Come on!

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>