Many times, in order to manage the code we write, we use a git remote repository for management and backup. Prevent code from being tampered with or deleted by others. So how do you create a remote repository?
1, we must have a remote server side, here can be any one computer as a server, create the steps:
[Email protected]:~$ pwd
/home2/boxbuilder
[Email Protected]:mkdir remote.git
To create a bare library, method:
[Email protected]:~$ git init--bare
Initialized Empty Git repository in/mnt/.mh/.fj/.ps/git/remote.git/
A remote repository has already created OK.
2. Create a git library locally and make it a library that you do not need to commit
Git init
git Add.
git ci-m "Test init."
Git remote add test ssh://[email protected]/home2/git/remote.git
git push test Marster
3. Other people need to use
git clone ssh://[email protected]/home2/git/remote.git
4. Execute submit push without server address
git push
Git pull
Git remote repository easy to create