Build your own remote repository

Linux systems
1 installed git yum the install curl-devel expat-devel the gettext-devel OpenSSL-devel zlib-devel Perl-devel
2 # add git user
the useradd git
# Set / home / git folder operation authority
chown git: git / home / git
# password; enter the password twice, the password easily, as can be twice
passwd git
3 configuration key
$ cd / Home / git /
$ mkdir .ssh
$ chmod 755 .ssh
$ Touch .ssh / authorized_keys
$ chmod 644 .ssh / authorized_keys (note authorized_keys not a folder, a text, the text is placed inside to wrap treatment between all the public keys, public key, you can not fight back in another public key)
4 initialize git repository
first we select a directory as a Git repository, assumed to be /home/gitrepo/runoob.git, enter the command in the / home / gitrepo directory:
$ cd / Home
$ mkdir gitrepo
$ chown git: git gitrepo /
$ cd gitrepo
$ git the init --bare runoob. git
The above command creates an empty Git repository, Git repository on the server usually end with .git. Then, the user changed the warehouse belongs to git:
$ chown -R git: git runoob.git
5, now create your own remote repository successful
clone git clone [email protected]: /home/gitrepo/runoob.git

Guess you like

Origin www.cnblogs.com/jjsdn/p/12069140.html