Git usage (local and associated remote, upload to remote)

Source: Internet
Author: User

Preface: This blog is used to hand over the homework, because homework, learning git, now feel, since there is this blog, it is good to use it, but also to develop a good habit, also to record it, about Git local repository upload, local and remote connection, from local to remote and some encountered errors /Problems and Solutions

First, install Git

This is the one, don't pretend to be wrong.

Second, set the public key/key

See https://coding.net/help/doc/git/ssh-key.html

Third, the establishment of local warehouses and documents uploaded to the local warehouse

Open a git window

1. Create a local repository git init

After success

When you open a folder, you may not see the new. git file because the file is hidden, and you can set the "Hidden file visible" to appear

2. Add files to the local repository git Add File/folder name

3. Submit the added file to the local repository git commit-m "commit instructions"

Here is said to submit the instructions can not be written, but it is a good habit, even if not to write a description, M should also have "", or error

The right

You can add files multiple times, and then commit all

Iv. local warehouses associated with remote warehouses and uploading items from the local warehouse to remote

1, in coding.net (estimated GitHub is similar), a new project, the project contains a remote warehouse address, the general use of SSH

2. Clone the project from local to remote Git clone and add the address of the remote repository (I use SSH)

3. Execute the statement

If an error appears, the display already exists, such as:

Then use to clear, note: Calculate is just a name

4. Upload files from the local repository to the remote repository

Failure Condition:

After Baidu, because in the remote warehouse construction project when the default file Readme.txt, and the local no such file, resulting in a conflict, resolution: 1, delete the remote file. 2, execute the command, so that the local add the file, the command is as follows:

Self-perception, this command is from the remote current file to the local role, after the execution of the command, you will find that the remote file exists in the local. Then execute the push command to push the local file to the remote.

PostScript: At present, the understanding of Git is this, the study is very preliminary, after the new study will be updated blog. In this part, the emergence of the public key is not very clear, to be strengthened, look at the blog, but also see the "Master branch" These, have not been to delve into, are learning the space

"Refer to some very good blogs: 51490480

Https://www.cnblogs.com/xiangyangzhu/p/5316041.html

Https://www.cnblogs.com/tinyphp/p/5025311.html

52215577

Https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/ 001374385852170d9c7adf13c30429b9660d0eb689dd43a000

Git usage (local and associated remote, upload to remote)

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.