Git: The local project to connect to a remote (github, gitee, gitlab) warehouse processes

When performing collaborative development or for backup code security needs, usually connected to the local code and the remote repository.

Note: Github, Gitee, Gitlab are three commonly used remote git repository, operational procedures are basically the same.

Environmental requirements in advance:

1.node.js installed. (Slightly installation method, with particular reference to  Windows with the Git Node.js installation )

2.git installed. (Ibid)

Process:

1. Create an empty remote project

 

 

 (If you do not want the project to be seen, you can choose private; if the project is to create a tutorial class, you can choose to be public so that the public)

 

2. Create a local folder, enter the folder, right click and choose "git bash here", enter the command "ssh -T [email protected]", to check whether the local key has been added to the remote repository, 

(If not prompted screenshot below, it indicates that the key is not the key configuration or changes, particularly with reference to the encryption key configuration github key )

 

3. In the folder, right-gitbash, enter the command "git init" to initialize;

 4. Enter the "touch filename" Create a txt file, submit links to facilitate testing;

 5. Enter "vi filename", enter the file editorial content, press "insert" key to enter the edit, 

 

6. When editing is complete, press the "esc" Exit Edit, enter ": wq", save and exit;

 

(New txt file contents and simultaneously enter another shortcut method: see below)

echo "File Contents" >> filename suffix

 7. Enter "git remote add origin remote repository link" link remote repository.

 8. Enter "git pull origin master" pull remote content repository;

 

 9. Enter "git add.", Add local files to the repository

10. Enter "git commit -m" comment "," submit comment

11. Enter "git push origin master", the file will be added push to a remote repository, the local project so far has been connected to a remote warehouse.

12. Start in the project folder development, each submission, according to a first sequence of steps 9-11 to! ! !

 

 

Guess you like

Origin www.cnblogs.com/chig/p/11969656.html