git beginner and upload project to remote repository github

Source: Internet
Author: User
Tags using git version control system

This article introduces the Git beginner's entry-level usage and how to successfully upload your project to GitHub via the GIT Bash tool, which is a learning experience note.

For Android developers, a GitHub account is the equivalent of your profile, so it's important to learn to use and manage it.

Git overview

What is Git?

At the beginning of this thing also feel very confused, and asked a lot of students have been learning Android for a period of time is also confused, until the understanding and use, only to realize the benefits of git and important significance.

Git: is currently the world's most advanced distributed version control system, an open-source Distributed version Control tool.

In simple terms (personally), it is a global programmer's code repository, where everyone can have their own small warehouse (register a separate account), your code can be saved here one by one, or can be shared to the global program ape-like people, So even if you're locally ~-~ your project (even if it explodes), you can be prepared by using Git to upload the previously submitted code from GitHub.

At the same time, it can record every version of the change, this does not need me to say that probably you can guess, in the future work if the co-version control can not be separated from the help of Git.

git installation

Under the Windows operating system, access to githttps://git-for-windows.github.io/, if not login directly Baidu search git download is also possible.

Installation process does not repeat, specify a good installation directory is good, after completion can be seen in the menu.

Create a local code warehouse

Open git Bash

Configure your identity first so that you can know who submitted it when you commit the code

Enter git config--global user.name "name"

git config--global user.email "email address"

After the configuration is complete, you can view your e-mail address and name, for example, my

Then start creating the Code warehouse, with the test project HelloWorld as an example

Enter GIT init to create ~

Then use Ls-al Query code warehouse, if you want to delete this warehouse, directly from the directory to delete this folder can be.


Submit Local Code

Once the warehouse is established, the local code can be submitted, only two commands are needed, add and commit

Add. is to submit all

Add + filename is a single file submission

Git commit-m "First commit" is submitted here to add the commit parameter after the-m parameter, it is important yo, otherwise it will be considered illegal can not be submitted.

This is where the introductory work comes in, and later features such as branching, collaborating with remote repositories, viewing records, and submitting records can all go straight to the git command and it's not difficult.

Pumpkin Split-line *************************************************** *********

Create a GitHub account and host local code

Go to the official website and click Sign to register for GitHub

https://github.com/

This is my personal page interface.

Then click New Repository to build the repository,

Click Create The repository button will then display your Repository home page

It is important to obtain the address of the remote repository after

Then open Gitbash.

Switch to the HelloWorld project directory and clone the remote repository to a local

Sometimes the transfer time-out is: Just try it a few more times.

This time your project directory will be more than a HelloWorld folder, the folder to copy all the directories in the previous level of the directory, you can add the entire project to version control.

Here's a hidden. git file, don't miss out!!!

After copying, you can delete the HelloWorld directory, then ls-al view the project directory


Then it is submitted to GitHub above the work!!!

Perform the commit operation first, then enter the GIT push Origin master synchronization

Note here to remember to enter the user name and password for identity validation!! Remember! Don't think it's not moving.

The password will not be displayed when you enter it. But you can do it after you lose your return.

The process may be slow, patient waiting, or it could be my campus network is poisonous.

Now refresh the version of HelloWorld Project on GitHub homepage

You have successfully uploaded the first project ~\ (≧▽≦)/~ la la la


git beginner and upload project to remote repository 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.