天天看點

NAS建立git伺服器

1.套件中心安裝 GitServer

NAS建立git伺服器

 2.設定允許通路的使用者(由于我使用的是root使用者,是以這裡設定限制不起作用)

NAS建立git伺服器

 3.建立一個共享空間,用來存放git倉庫的位置。我這裡設定了32GB.

NAS建立git伺服器

4.使用超級終端登入到nas,然後建立一個本地git 倉庫。

root@LsyDs918:/# cd volume1/
root@LsyDs918:/volume1# ls
git_server
root@LsyDs918:/volume1# cd git_server/
root@LsyDs918:/volume1/git_server# ls
@eaDir  #recycle
root@LsyDs918:/volume1/git_server# ls
@eaDir  #recycle
root@LsyDs918:/volume1/git_server# ls
@eaDir  #recycle
root@LsyDs918:/volume1/git_server# mkdir CarSystem.git
root@LsyDs918:/volume1/git_server# cd CarSystem.git/
root@LsyDs918:/volume1/git_server/CarSystem.git# ls
root@LsyDs918:/volume1/git_server/CarSystem.git# git init --bare
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint:   git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint:   git branch -m <name>
Initialized empty Git repository in /volume1/git_server/CarSystem.git/
root@LsyDs918:/volume1/git_server/CarSystem.git# ls
branches  config  description  HEAD  hooks  info  objects  refs
root@LsyDs918:/volume1/git_server/CarSystem.git# cd ..
root@LsyDs918:/volume1/git_server# ls
CarSystem.git  @eaDir  #recycle
root@LsyDs918:/volume1/git_server# chown -R root:root CarSystem.git/
root@LsyDs918:/volume1/git_server# chmod -R 770 CarSystem.git/      

以上内容其實就是在linux下建立一個倉庫。參考之前的連結:

​​(3條消息) Linux下搭建本地git伺服器_Liu-Eleven的部落格-CSDN部落格_linux搭建git本地伺服器​​ 

$ git clone ssh://[email protected]:223/volume1/git_server/CarSystem.git
Cloning into 'CarSystem'...
The authenticity of host '[192.168.1.123]:223 ([192.168.1.123]:223)' can't be established.
ED25519 key fingerprint is SHA256:DlZbOwdBHVCtjECIJ5Fn1nWyhdM3COjxrYZmhwQ/pYI.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[192.168.1.123]:223' (ED25519) to the list of known hosts.
[email protected]'s password:
warning: You appear to have cloned an empty repository.