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.
I suddenly realized that I had an audience. Touched the tears ran ...
Then click New Repository to build the repository,
Click the Create Repository button and your Repository home page will be displayed.
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
Recently finally chewed out "first code", but in the last project in practice the cool weather encountered in the book provided the website interface API expires the problem .... Finally had to change a return data for the XML type of interface URL--and then changed the original parsing class swap pull parsing, busy a few nights and learning PA's friendship with the help of ... Finally can realize the basic function ... Although very difficult, but also a lot of harvest, the following is the GitHub address, which has been written before the unfinished version of Guaweather
Https://github.com/jiangzhengnan/coolweather
git--Getting started with uploading items to remote repository GitHub (RPM)