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, login GitHub , create a new warehouse, gitskills
named :
We tick Initialize this repositorywith a README
, so GitHub will automatically create one README.md
for us file. Once created, you can see the README.md
file:
now that the remote library is ready, the next step is to use the command git clone
Clone a local library:
git clone git
@github .
com:michaelliao/gitskills.git
Cloning into
' Gitskills '...
Remote: Counting objects: 3, done.
Remote: Total 3 (delta
0 ), reused
0 (delta
0)
receiving objects: - % (
3 /
3), done.
cd gitskills
ls
Readme.md
Pay attention to Git change the address of the library to your own, then enter gitskills
catalogue Look, already there README.md
the 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 https://github.com/michaelliao/gitskills.git
this address. In fact, git supports multiple protocols, the default git://
use ssh https
Use https
In addition to the slow speed, there is one of the biggest trouble is that each push must enter a password, but in some only open http the port is not available ssh
inside the company protocol and can only be used https
.
Summary
to clone a warehouse, you must first know the address of the warehouse, and then use git clone
command cloning.
Git supports multiple protocols, including https
, but through ssh
supported native git
the speed of the protocol is the fastest.
git9--cloning from a remote library