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.