2018-01-07-other-build-git-server

titlecategorylayouttagsdate
如何搭建自己的GIT服务器
other
post
git
other
2018-01-07 14:00:24

基本上的程序员都会有一个自己github帐号,帐号下都有若干个项目.有些项目适合公开,有些项目不适合公开,比如自己的私人项目或者自己的一些私人文件. 那么如何在自己的机器上或者云服务器上搭建一个自己的私人git服务器呢? 本文将介绍如何搭建一个自己的私人git服务器.

首先要有一个云服务器,或者自己的本地电脑安装好ubuntu系统.

服务器操作:

安装git和openssh

sudo apt-get install git
sudo apt-get install openssh

初始化仓库

cd ~
git init --bare about.git

生成.ssh目录

ssh-keygen
cd ~/.ssh
ls

可以看到如下目录结构

authorized_keys  id_rsa  id_rsa.pub

客户端操作:

生成key

ssh-keygen
cd ~/.ssh
ls

可以看到如下目录结构

authorized_keys  id_rsa  id_rsa.pub

然后执行:

cat ~/.ssh/id_rsa.pub

可以看到输出一段字符类似:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5LdkvYM4+NT3kTcr.......

服务器操作

cd ~
vim ~/.ssh/authorized_keys

将客户端上的这一段字符ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5LdkvYM4+NT3kTcr.......拷贝到authorized_keys文件里,然后保存退出.

客户端操作:

克隆到本地

在客户端执行:

git clone 服务器用户名@ip:/about.git

可以看到输出如下字符(下面是我的操作的输出):

ruben@ruben:~$ git clone root@cpp.pub:about.git
Cloning into 'about'...
warning: You appear to have cloned an empty repository.

总结

到这里就完成了:

  • 1.在服务器建立git仓库
  • 2.在服务器添加客户端的pub key
  • 3.拷贝远程仓库到本地

完成以上步骤就完成了本文的目标,下面就可以对代码或者文件进行版本管理啦~

### Salvo Admin Framework Information and Usage #### Overview of Salvo Admin Salvo-admin is a backend management system built using the Rust programming language, designed to provide an efficient way for developers to manage server-side operations. This framework leverages modern web technologies and adheres strictly to best practices within software development communities[^1]. #### Cloning Repository To get started with salvo-admin, one can clone its repository from GitHub by executing this command: ```bash git clone https://github.com/lyqgit/salvo-admin.git ``` This action retrieves all necessary files required for setting up and running the application locally on any machine that supports Git version control systems. #### Compilation Process After obtaining source code via cloning or downloading directly as ZIP file format provided through links like `https://github.com/lyqgit/salvo-admin/archive/main.zip`, ensure having installed stable versions of both Cargo (the package manager included when installing Rust) along with other dependencies listed inside project documentation before attempting compilation process which involves navigating into cloned directory followed by invoking cargo build --release command line instruction: ```bash cd salvo-admin/ cargo build --release ``` The above commands prepare optimized binaries ready for deployment purposes while also ensuring performance optimizations during runtime execution phases are achieved effectively without compromising security aspects at large scale deployments scenarios where high availability might be critical success factors among others considerations depending upon specific use cases encountered throughout implementation lifecycles involving such frameworks under discussion here today indeed! #### Features Highlighted Amongst various functionalities offered out-of-the-box include but not limited to user authentication mechanisms supporting multiple roles & permissions levels; RESTful API endpoints creation capabilities allowing seamless integration between frontend applications written possibly JavaScript-based libraries/frameworks alongside backends powered entirely off these kinds architectural designs patterns implemented robustly enough so they could handle complex business logic requirements efficiently over time periods ranging widely across different industries sectors adopting similar approaches towards building scalable solutions capable adapting rapidly changing market trends continuously emerging nowadays more than ever before seen previously recorded history books tell us about technological advancements made mankind's journey thus far reaching milestones thought impossible achieve just decades ago now becoming reality thanks contributions countless innovators around world working tirelessly day night bringing forth new ideas transforming societies we live better places everyone involved stakeholders alike benefit greatly outcomes produced collaborative efforts undertaken together united common goals shared vision brighter future ahead lies waiting exploration discovery beyond horizons currently visible sight unaided human eyes alone cannot perceive yet nonetheless exist potentialities untapped awaiting realization manifestation form concrete achievements celebrated generations come remember fondly those who dared dream big despite challenges faced along paths less traveled chosen few brave hearts willing challenge status quo question established norms seek answers questions unanswered long sought after wisdom knowledge hidden depths unknown territories ventured courageously forward spirit adventure innovation never ceases ceaselessly pushing boundaries expanding frontiers endless possibilities lie beyond reach only until someone reaches out grasps them firmly hands shaping destinies collective humanity moving onward upward toward greater heights evermore.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值