Easy steps for beginners to use Git to upload code to coding

Source: Internet
Author: User
Tags windows download git client

Easy steps for beginners to use Git to upload code to coding

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

1 git  init

  

(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/用户名/项目名.gitgit 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 initgit addgit commitgit remote add origin https://git.coding.net/用户名/项目名.gitgit 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/

Easy steps for beginners to use Git to upload code to coding

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.