1. First login Coding website registered account https://coding.net/
(after registration, you need to login email to activate email)
2. Login to the newly registered coding account and add the project
Add a project-〉 enter a project name-〉 Enter a brief description of the project---) select "Public"-〉 Create Project
To this end, you will need to push the experiment content to the project Chap1 later.
Here, you need to record Http://git.coding.net/gdcs16_000/chap1.git (gdcs16_000 for your registration name, CHAP1 for the created project name)
You can also select your project-〉 code through the coding website to find
3. Installing the GIT client
Install git software first: git for Windows download.
Detailed instructions in the installation process can be found in
http://blog.csdn.net/vipzjyno1/article/details/22098621
4. Create a local git repository
Create a folder on your local disk to hold files that need to be push to coding. Open this folder and right-click-〉git Bash here
Input
(After this step completes, a hidden. Git suffix file is generated under this folder)
5. Add, submit files to the local repository
Create 3 new files in the test folder you just created, add and submit the files to the local repository
The command to use:
123 |
git add . 或者 git add <filename> git commit –m "项目描述" |
6. Push local files to the coding server
123 |
git remote add origin https: // git.coding.net/用户名/项目名.git git push origin master |
After successfully uploading the file
7. Problems encountered in Push process and their handling methods
(1) If push encounters no permissions, no prompt for user name and password Direct 403 problem
Processing method: Directly modify the URL in the. git/config file:
https://coding User name: password @git.coding.net/user name/project name. Git
or by command:
Git remote add Origin https://coding user name: Password @git.coding.net/username/project name. Git
(2) if a (Non-fast-forward) error occurs ,
Can be used directly with-f (forced push)
Git push–f Origin Master
Summarize use of the command, mainly have
12345 |
git init git add git commit git remote add origin https: //git.coding.net/用户名/项目名.git git push origin master |
8. For more detailed instructions on git, please refer to the following documents
[1] Git code hosting in coding website help
Https://coding.net/help/faq/git/git.html#git--git--codingnet
[2] git tutorial (Liaoche's official website
http://www.liaoxuefeng.com/
[3] More detailed git principles and usage
Https://git-scm.com/book/zh/v2
[4] git's easy guide
http://www.bootcss.com/p/git-guide/
Transfer from https://www.cnblogs.com/gdfhp/p/5889168.html
Easy steps for beginners to use Git to upload code to coding