The mac terminal pushes the code library to github, the code library github

Source: Internet
Author: User

The mac terminal pushes the code library to github, the code library github

I:

Installing git and configuration is omitted. There are too many tutorials on the Internet.


II:

1. cd to the project directory

2. Initialization

Git init

After initialization, A. git hidden file is automatically created in the local code library. This is the local code library.

Iii. File Loading

Git add.

Is to load all the files in the folder

You can also load a single

Git add index.html, test.html

4. Submit the file at the Creation Time

Git commit-m "init commit"

-M "comment content in quotation marks"

After creation, you can return to this time point at any time. You can see that several files have been modified, several files have been inserted, and several files have been deleted.

You can view git status at any time using git status

V:
Push code

Add a remote code library to the configuration during the first push.

Gitremote add origin master https://github.com/JarryChang/JarryChang.github.io.git

Push git push origin master

6. My questions

The above should be completely correct, but I failed to push it for a long time. At first, the connection failed due to poor network speed.

Today, I tested the network speed and found that the speed was superb. I had to find the reason.

Check the information and find that two Xcode versions, one version 5.1 and the other version 6.1, are installed. I wonder if this is the reason, and then run the following command on the terminal:

Sudo xcode-select-switch/Applications/Xcode6.1.app/Contents/Developer. in step 5 above, the red https path is changed to a problem.

Ssh path git@github.com: JarryChang/JarryChang. github. io. git, so the problem is solved.

The problem is solved, but it is not clear. Note.

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.