How to upload your Android project to GitHub

Source: Internet
Author: User

Because the internship unit needs, recently studied GitHub's play, instantly feel their previous use of SVN weak explosion has no!

Because you didn't do a very deep study, here's a first step to sharing your project with GitHub.

This assumes that you already have a GitHub account (what are you waiting for if you don't have an account?). ),
And Git is already installed on the computer (if it's not installed, you can download and install a github for Windows,linux user in Ubuntu for example, enter the command "sudo apt-get install Git-core" directly in the terminal)

First, create a warehouse on GitHub

It's easy to create a warehouse on GitHub:

Click the green "New repository" to start creating the warehouse.

According to the prompt, fill in the warehouse name, the. gitgnore file (ignoring files, ignoring some unnecessary files) designated as Android, click "Create Repository" created.

When you're done, jump to the warehouse home page. Maybe some people think the warehouse name is not satisfied, here teach you a delete warehouse steps.

Click the Setting button on the right side of the warehouse homepage to go to the Settings page

The options option is generally default, with a "Delete this Repository" button at the bottom

Click to enter the project name in the popup dialog box.

Well, back to our theme, on the right side of the home page of the warehouse, there is an "HTTPS done URL" below the setting, click the button next to the text box to copy it down, and our GitHub warehouse creation is over.

Second, create Android project

Here is not verbose, see this article people certainly do not need to teach this, in short, there is an Android project is good, but remember, this project will be we will upload to GitHub, so, development, this should be our working directory.

I have a project here that has been created, called the game, and you can see the list of files in the directory:

Third, create a local git repository

There are many kinds of git tools, and we'll just mention command-line operations that can be used on all platforms.
No contact with the command line of the classmate also do not feel difficult, in fact, the command line used to use, than the graphical interface is also useful, addictive ^_^

I use GitHub for Windows to bring the Shell tool, no other command-line tools can also, of course, Windows CMD may need to configure the environment variables themselves, the git command configuration.

Talk less, open the shell tool and go to the created Android project directory.

I am here under the F disk under the Android directory of the game project.

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

git config --global user.name"Lemoner"git config --flobal user.email"[email protected]"

Because I used GitHub for Windows to sign in, so here is not the show command, the command is written out to everyone, the quotation marks in the user name and mailbox to your own is OK.

After the configuration is complete, you can enter the same command to see if the configuration was successful

To clone a project on GitHub, you'll need to use the GitHub warehouse address that you just started copying, and copy it.

clone https://github.com/Lemoner/demo.git

See the following tips to show that you cloned successfully.

Follow the prompts in the F:\Android\Game directory next to see a directory with the same name as the GitHub repository, the files are copied to the previous level of the directory, GitHub name directory can be deleted.

Enter the command below to add the file to version control:

add .

Note that the space behind the add must be added, or it will be an error.

Once added, execute the Submit command

commit -m "My First Commit"

This commits the modifications to the local repository

Next, upload the local repository content to GitHub.

push origin master

The final step if you do not have a login may require your GitHub password, just follow the prompts to enter the good.

Until the command is completed, the above prompts indicate that the submission is complete.

Take a look at GitHub.

Go to the Warehouse homepage, is not already synchronized up.

Attached: Citation statement

"First line of code Android" Guo Lin

Baidu experience "How to delete a project on GitHub"
Address: Http://jingyan.baidu.com/album/63acb44ae77d2961fcc17ede.html?picindex=1

How to upload your Android 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.