If you are not used to using the command line, I recommend you to upload another blog using Github client: Github client upload.

Below for how to use the command line under the handsome upload code to making the Internet a lot, you want to install git, deserve to act the role of SSH, bloggers don’t need here, explain the reason, as long as installed Xcode, default have git, SSH configuration is to do not need to submit every time input password, bloggers feel lost password seems to also do not have what, Convenient point, of course, if you want to, you will open the web search how to configure SSH, bloggers to recommend a configuration: www.07net01.com/2015/08/895… .

Here is the command line operation:

Create a git repository on Github:

The following initialize this… Select according to need

2. CD to the project that needs to be uploaded, the blogger can put it on the desktop



This Demo is used as an example.

3. Initialize git:

git init
Copy the code

4. Add to Git, the file index

Git add. (with Spaces between. And add)Copy the code

5. Add it to the temporary warehouse

Git commit -mCopy the code

6. Commit to the remote repository

git remote add origin https://github.com/codeliu6572/justForFun.git
Copy the code

HTTPS link source, as shown below:



(You can also use the link to this HTML page:Github.com/codeliu6572…)

Fatal: remote origin already exists. That is because the blogger has already submitted the Demo, and now has changed the address, to delete Origin, and submit again.

git remote rm origin
Copy the code

Then resubmit to the remote repository and execute the command line above.

7. Push local code to the server because it is the first time to commit, so there is no need to pull down the server update, so

Git push -f origin master -f origin masterCopy the code

If you see the following picture, it means that the upload is successful:

8. Update the Demo content after updating the content:

Git add. Git commit -m "update description" Git pull origin master -f -f -f -f -f -f -f -fCopy the code

Here is the github of the Demo operated by the blogger: github.com/codeliu6572…

The above can basically meet the submission, more and deeper operations, we need to continue to understand. If you already use Git to manage your code, this is not a problem for you. If you don’t use Git, you just need to learn the basics and try it a few times.