root@minloha:~# id git id: ‘git’: no such user root@minloha:~# adduser git Adding user `git' ... Adding new group `git' (1000) ... Adding new user `git' (1000) with group `git' ... Creating home directory `/home/git' ... Copying files from `/etc/skel' ... New password: Retype new password: passwd: password updated successfully Changing the user information for git Enter the new value, or press ENTER for the default Full Name []: iMinloha Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] root@minloha:~#
然后我们随便新建一个文件夹作为我们的git存放的地方
1 2 3 4 5 6 7 8
root@minloha:~/home# cd git root@minloha:~/home/git# git init --bare MinProject.git Initialized empty Git repository in /root/git/MinProject.git/ root@minloha:~/home/git# ls MinProject.git root@minloha:/home/git# chown -R git:git MinProject.git chown: invalid user: ‘git:git’ root@minloha:/home/git#
# 先克隆服务端的git,记得修改ip C:\Users\Minloha\Desktop\demo>git clone git@你的IP:/home/git/MinProject.git Cloning into 'MinProject'... The authenticity of host 'XXX.XXX.XXX.XXX (XXX.XXX.XXX.XXX)' can't be established. ECDSA key fingerprint is SHA256:wZ1TgMK+m4PnfJkXKeUSTRLqmkaPeXVMXye1ijRkZK0. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'XXX.XXX.XXX.XXX' (ECDSA) to the list of known hosts. git@XXX.XXX.XXX.XXX's password: warning: You appear to have cloned an empty repository.