The last time we talked about a local library, and then a remote library, how to associate the remote library.
Now, assuming that we are developing from scratch, the best way is to first create a remote library and then clone from the remote library.
First, log on to GitHub and create a new repository named gitskills
:
We tick Initialize this repository with a README
, so GitHub will automatically create a file for us README.md
. Once created, you can see the README.md
file:
Now that the remote library is ready, the next step is to git clone
clone a local library with a command:
$ git clone git @github. Com:michaelliao/gitskills.gitcloning into ' Gitskills ' ... remote: counting objects: 3 , done. remote: total 3 (Delta 0), Reused 0 (Delta 0) receiving Objects: 100% (3/3), Done. $ cd gitskills$ lsreadme.md
Be careful to replace the GIT repository's address with your own, then go to the gitskills
directory and look at the README.md
file.
If there is more than one person collaborating on the development, then each individual from the remote clone a copy can be.
You may also notice that GitHub gives more than one address and can also use such an https://github.com/michaelliao/gitskills.git
address. In fact, GIT supports a variety of protocols, git://
using SSH by default, but can also use https
other protocols.
With the https
exception of slow speed, one of the biggest problems is that each push must enter a password, but in some companies that only open HTTP ports, the protocol cannot be used ssh
https
.
Summary
To clone a warehouse, you must first know the address of the warehouse and then use the git clone
command clone.
GIT supports a variety of protocols, including https
, but with the fastest ssh
supported native git
protocols.
Git tutorial-cloning from a remote library