It's important for programmers to manage their own code properly, and today I'm on GitHub's escrow path.
To host your code on GIT, first you need to create a code repository on GitHub's website to put your code in.
One, to be hosted on GitHub, you should have a GitHub account that belongs to you, so you should go to github.com to register
Open your browser
Enter address in address field: github.com
Fill in the user name, email, password
Simply register by clicking Sign Up
Second, complete the registration, enter the GitHub platform,
Click New repositories
Create a new project (you can also add to an existing project)
Third, the operation of the new project, in fact, is very simple, enter the project name can directly create a
Here remember to put initialize this repository with a readme, option check on, (Do not check the rookie of us you will not understand)
Four, at this time the interface, I think everyone should be very familiar with. Click the Clipboard icon in the right column to record your project address.
I use the version is on the right, the version may be different location, the address is unique;
This way your online code warehouse is created, and then the installation of the client to the local code to the Internet, it is recommended to use smartgit;
First go to the official website to download a client, here does not say how to install software, direct prompt next on the line;
After installing the client, it is used,
One, open smartgit, select Repository→clone in the menu
Cloned here is your online created warehouse, clone down only a description file
2, fill in repository Url:github to provide us with the address, the project just built on the right side of the page to find the project address and copied over. The address here is your Gituhub address 3, next step, select a local folder for the project.
Here the file name is automatically created for you, you directly finish on the line, click Finish, wait a moment, the output of the information tells us that OK is done. Open the local folder you just selected.
So your local repository will be created.
、、
This is my newly created local repository, GitHub's process is your code---The Local warehouse---online, smartgit is to submit the local code to the online tool, so the understanding is right, the following is how to put the code into the local warehouse, where the local warehouse is the folder you just created, Here is where you put the code, and Smartgit point to this folder, this is the local warehouse folder I created, you can open this folder in your development tool directly to develop, so that your code is automatically written to the local warehouse.
This is the project I opened with the development tool, then Smartgit will automatically appear some compiled files, because your development tools and smartgit operation is the same folder as shown below
, of course, these files are not code, just compile the file, you can not upload, you can select all right click Ignore, ignore (here to note that when you commit the code, to see carefully, those are compiled files, those are your own code files, your own code files, You get a name yourself always know it), here I in my development tools to add a new file to the project, Smartgit also corresponding to a file, this file is you want to submit, the following diagram
(If you really do not you just create a new text in the folder, look at it, Smartgit will also appear in your new folder, and then give you a picture)
Then it was submitted (I deleted the new text document) Select your file right-click on commit (Submit)
Will pop up a commit box, above is your code file, below you write the file comment, then commit on line, commit after the following image
The right side display is already submitted successfully, here the submission is successful you can understand that smartgit know the code you want to submit, and then you have to look at the left side of the local Branches, Master1>origin, where the ">" is not greater than the symbol, but point to the symbol, It means you also need your local code to submit to the online check master1>origin, right click Push, is to put your code to submit to the Internet
The right-hand tip box shows that push is successful, the local Branches on the left, Master=origin, the code version of your native, and the code on the Web is consistent with the map, look at the code on GitHub
So your code will be submitted to the Internet. This is only preliminary use, advanced please pay attention to the next blog, here to point to suggestions, their own try, online information is always not careful, or the problem will always have a new, I am also my own groping out, how to grope (. Githjub, on the warehouse casually built, do not have money, you build a, casually try, casually upload, you learned, the useless warehouse deleted on the line