Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to add remote Warehouse by Git

Shulou Source: shulou.com Published: 2022-06-02 07:35:39 10月05日 Update

This article mainly explains "how to add remote repository in Git". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "Git how to add remote warehouse"!

Premise: There is only one master branch for both remote and local

1. There are files in the local repository, and the remote server has a new repository on it. 1 git init test2 Create a new file in the repository to edit the content (e.g. test.txt) 3 git add test.txt4 git commit test.txt -m 'submit test.txt'5 git remote add origin git@gitee.com blues/test.git Add the remote repository address to the local repository, named origin, origin is also the name of the default repository, can also be named other names 6 git push -u origin master Associate the master branch of the local repository with the master branch of the remote repository Push the files of the master branch of the local repository to the master branch of the remote repository 7 After 7, git pull / git push ... Since origin is the default remote repository name, pull and push and use the above commands directly. If the name is other, you need to make the repository name and branch name, such as the master branch of a repository: git push a master2, remote server has a lot of code above, to pull to the local start development of this simple, direct: git clone git@gitee.com blues/test.git and then add, commit, pull, push can be here, I believe everyone on "Git how to add remote repository" has a deeper understanding, might as well do it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Tags: Warehouse branch name content file server learning service practical deeper code interest premise only command address practicality practical simple operation method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Tech Info Microsoft Huawei Shulou Information