Git(九)服务器搭建

Git本地仓库的搭建与使用 本篇文章详细讲解了在没有github、gitee情况下,如何搭建自己的本地仓库进行代码托管,博主将从Linux系统、Windows系统下分别为大家整理。 阅读详情

上一章节中我们远程仓库使用了 Github,Github 公开的项目是免费的,但是如果你不想让其他人看到你的项目就需要收费。

这时我们就需要自己搭建一台Git服务器作为私有仓库使用。

接下来我们将以 Centos 为例搭建 Git 服务器。

1、安装Git

$ yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
$ yum install git

接下来我们 创建一个git用户组和用户,用来运行git服务:

$ groupadd git
$ useradd git -g git

2、创建证书登录

收集所有需要登录的用户的公钥,公钥位于id_rsa.pub文件中,把我们的公钥导入到/home/git/.ssh/authorized_keys文件里,一行一个。

如果没有该文件创建它:

$ cd /home/git/
$ mkdir .ssh
$ chmod 755 .ssh
$ touch .ssh/authorized_keys
$ chmod 644 .ssh/authorized_keys

 

3、初始化Git仓库

首先我们选定一个目录作为Git仓库,假定是/home/gitrepo/runoob.git,在/home/gitrepo目录下输入命令:

$ cd /home
$ mkdir gitrepo
$ chown git:git gitrepo/
$ cd gitrepo

$ git init --bare runoob.git
Initialized empty Git repository in /home/gitrepo/runoob.git/

以上命令Git创建一个空仓库,服务器上的Git仓库通常都以.git结尾。然后,把仓库所属用户改为git:

$ chown -R git:git runoob.git

4、克隆仓库

$ git clone git@192.168.45.4:/home/gitrepo/runoob.git
Cloning into 'runoob'...
warning: You appear to have cloned an empty repository.
Checking connectivity... done.

192.168.45.4 为 Git 所在服务器 ip ,你需要将其修改为你自己的 Git 服务 ip。

这样我们的 Git 服务器安装就完成。

Git 服务器搭建 上一章节中我们远程仓库使用了 Github,Github 公开的项目是免费的,2019 年开始 Github 私有存储库也可以无限制使用。当然我们也可以自己搭建一台 Git 服务器作为私有仓库使用。 阅读详情

相关推荐

HDMI调试避坑指南:从AVI InfoFrame到通用控制包,这些DataIsland Packet细节千万别忽略

本文深入解析HDMI调试中DataIsland数据包的关键细节,包括AVI InfoFrame、通用控制包和音频时钟再生包(ACR)的配置与故障排查。通过实际案例和寄存器配置示例,帮助工程师快速定位显示异常、色彩失真和音频中断等问题,提升HDMI接口调试效率。

weixin_30897233的博客 635

搭建自己的git仓库之简单搭建本地git仓库和远程git仓库~

最简单的从建立本地git仓库、远程仓库、远程本地仓库连接;将文件提交到本地仓库并推送到远程仓库的一个完整简单步骤,希望对初学者有用~

wangtinger的博客 1万+

Silvaco Atlas(五)——物理模型总结

物理模型总结

qsz1425AWD2121的博客 2149

5分钟教会你如何搭建自己的git仓库

新手如何快速拥有自己git项目,为自己简历添彩

码上代码的博客 9769

R语言实战:5分钟搞定GEO单细胞数据(scRNA-seq)下载与整理(附完整代码)

本文详细介绍了如何使用R语言快速下载和整理GEO单细胞数据(scRNA-seq),提供完整的自动化处理代码。从环境准备、数据获取到文件整理和质量检查,涵盖10X Genomics标准格式及非标准数据的处理技巧,帮助生物信息学研究者高效完成数据预处理工作。

weixin_29054399的博客 600

工厂自动化布线实战:从功率计算到线槽布局的完整避坑指南

本文详细介绍了工厂自动化布线的实战经验,从功率计算到线槽布局的完整避坑指南。通过三步计算法确定线径需求,强调电压降控制的重要性,并分享线槽布局的50%法则和强弱电分离技巧。特别针对移动设备和多芯信号线提供专业解决方案,帮助工程师避免常见错误,提升布线效率和质量。

weixin_29266007的博客 350

小白推荐|使用git建立自己的代码仓库

版本控制工具,用于团队协作与项目管理GitHub是一个使用Git进行软件开发和版本控制的互联网托管服务。

maple05的博客 1万+

LS-DYNA中的流固耦合

在LS-DYNA中对流固耦合问题的求解提供了两种方法,ALE流固耦合和基于ICFD的流固耦合。本文将对两种方法的各自特点进行分析。 ALE方法的流固耦合 适用范围 ALE求解器主要用于层流。ALE求解器也不是完全的NS求解器,因此不考虑边界层的影响,比如阻力。流体粘性效应仅通过材料模型获得,也就是*mat_null的MU。ale求解器是为了求解高压高速度梯度的短时问题而开发的。该求解器并不适用于求解低压力梯度问题比如声学,也不适用于长时间问题(秒的尺度甚至更长)。时间的限制是显式时...

m0_69812055的博客 8554

搭建Git远程仓库详细步骤(保姆级)

手把手讲解git最基础的使用

cesheng3410的博客 1万+

华为OD机考双机位C卷 - 斗地主之顺子 (Java & Python& JS & C/C++ & GO )

华为OD机考双机位C卷 - 斗地主之顺子(OD上机考试双机位C卷)。提供在线OJ刷题。Java、C++、Python、GO语言、C语言、JavaScript题解,并提供完整思路讲解。

算法大师! 9692

YOLOv12改进策略【注意力机制篇】| 添加SE、CBAM、ECA、CA、Swin Transformer等注意力和多头注意力机制

这篇文章带来一个经典注意力模块的汇总,虽然有些模块已经发布很久了,但后续的注意力模块也都是在此基础之上进行改进的,对于初学者来说还是有必要去学习了解一下,以加深对模块,模型的理解。

Limiiiing的博客 1509

git的使用学习(九)搭建git服务器

搭建Git服务器 在远程仓库一节中,我们讲了远程仓库实际上和本地仓库没啥不同,纯粹为了7x24小时开机并交换大家的修改。 GitHub就是一个免费托管开源代码的远程仓库。但是对于某些视源代码如生命的商业公司来说,既不想公开源代码,又舍不得给GitHub交保护费,那就只能自己搭建一台Git服务器作为私有仓库使用。 搭建Git服务器需要准备一台运行Linux的机器,强烈推荐用Ubuntu...

weixin_30787531的博客 70

【异常】OpenClaw 飞书端 OpenClaw: access not configured. Pairing code: [] Ask the bot owner to approve with

摘要: OpenClaw飞书机器人交互中出现的access not configured报错,是因用户或组织未配置访问权限触发的拦截提示。报错包含组织单元ID和配对校验码,需管理员审批开通权限。普通用户需提交完整报错信息给管理员处理;管理员可通过执行标准化命令单次审批,或批量配置组织白名单优化权限管理。建议提前梳理权限范围、及时同步组织架构变更,并定期审计权限列表以确保安全合规。

奶爸的编程之路,也就一周冷个三天 370

Git学习笔记之GitLab服务器搭建过程(九)

说明: GitLab是GitHub的免费私有库替代方案,并且安装与配置都很方便。 本人自己搭建的时候用的是1核1GB的CentOS7.6的腾讯云服务器,最后初始化命令后一直报错失败。后来选用2核4GB的CentOS7.6的腾讯云服务器一次成功。 查阅相关资料如下: 安装完成后,系统内存图如下所示: 参考地址 官网地址:https://about.gitlab.com/...

叶秋雨_Roman 443

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

Ubuntu下搭建Git服务器

下面搭建的git服务器的简易网络拓扑图如下所示: 一、安装及配置所需软件[Git服务器,coffee@workpc1] git-core是git版本控制核心软件,而且git是通过ssh协议来在服务器与客户端之间传输文件,故openssh-server、openssh-client必不可少。 sudo apt-get install git-core openssh-ser

周翔的专栏 1万+

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Git进阶之搭建Git服务器

本文介绍了Git服务器搭建与命令别名配置的实践指南。第一部分详细讲解了在Linux系统上搭建本地Git服务器的步骤,包括安装Git、创建专有用户、设置证书登录、初始化仓库等关键操作,并提供了本地简化版的搭建方案。第二部分重点阐述了Git命令别名的配置技巧,通过设置status、checkout、commit等常用命令的简写形式(如st、co、ci),可显著提升命令行操作效率。文章采用实践导向的教学方式,包含完整的操作示例和测试验证方法,帮助开发者快速掌握Git的核心应用技能,为后续团队协作开发奠定基础。

m0_74311877的博客 1267

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

【Git】Gitee服务器搭建

到目前为止已经有办法使用 Git 来完成日常工作。然而,为了使用 Git 协作功能,你还需要有远程的 Git 仓库。尽管在技术上可以从个人仓库进行推送(push)和拉取(pull)来修改内容,但不鼓励使用这种方法,因为一不留心就很容易弄混其他人的进度。此外,你希望你的合作者们即使在你的电脑未联机时亦能存取仓库 — 拥有一个更可靠的公用仓库十分有用。因此,与他人合作的最佳方法即是建立一个你与合作者们都有权利访问,且可从那里推送和拉取资料的共用仓库。架设一台 Git 服务器并不难。

C/C++软件工程师、嵌入式软件工程师、物联网研发工程师、C/C++讲师、物联网讲师、嵌入式讲师、鸿蒙讲师---欢迎大家一起交流(私信添加博主微信) 6688

Git本地服务器搭建及使用

Git是一款免费、开源的分布式版本控制系统。众所周知的Github便是基于Git的开源代码库以及版本控制系统,由于其远程托管服务仅对开源免费,所以搭建本地Git服务器也是个较好的选择,本文将对此进行详细讲解。(推荐一家提供私有源代码免费托管的网站:Bitbucket,目前支持一个项目5个成员) 搭建环境: 服务器:intel i5 / 8g内存 / 64位操作系统  Ubuntu 15.04 ...

pansaky的博客 1万+

【Git】本地git服务器搭建

到目前为止已经有办法使用 Git 来完成日常工作。然而,为了使用 Git 协作功能,你还需要有远程的 Git 仓库。尽管在技术上可以从个人仓库进行推送(push)和拉取(pull)来修改内容,但不鼓励使用这种方法,因为一不留心就很容易弄混其他人的进度。此外,你希望你的合作者们即使在你的电脑未联机时亦能存取仓库 — 拥有一个更可靠的公用仓库十分有用。因此,与他人合作的最佳方法即是建立一个你与合作者们都有权利访问,且可从那里推送和拉取资料的共用仓库。架设一台 Git 服务器并不难。

C/C++软件工程师、嵌入式软件工程师、物联网研发工程师、C/C++讲师、物联网讲师、嵌入式讲师、鸿蒙讲师---欢迎大家一起交流(私信添加博主微信) 6049

Linux下搭建自己的Git服务器

首先需要装好CentOS系统,作为测试,你可以选择装在虚拟机上,这样比较方便。这步默认你会,就不讲了。 有了CentOS,那么如何搭建Git服务器呢? 1、首先需要安装Git,可以使用yum源在线安装:[root@localhost Desktop]# yum install -y git2、创建一个git用户,用来运行git服务adduser git 3、初始化git仓库:这里我们选择/da

xiaowen555555 1万+

搭建自己的git服务器

1. 环境: git服务器:CentOS-7.6-x86 本地客户端:window10 2. 软件安装 yum install git -y 3.创建一个操作系统用户git,设置密码,并为其建立一个.ssh目录。 adduser git passwd git chmod 755 /home/git su git cd mkdir .ssh && chmod 700 .ssh touch .ssh/authorized_keys && chmod 600 ...

大帅的博客 3558

Linux上搭建Git服务器

在阿里云服务器上搭建一个私有的Git服务器 由于github可以免费帮我们管理项目(即项目的版本控制),因此我们通常会将一些开源项目放在github的公共仓库。 但我们经常会有这样的需求:出于商业目的,我们必须要项目的源文件进行保密。 这个时候再用github的私有仓库管理我们的项目就不合适—github的私有仓库是“收费”的。 这个时候,我们就可以考虑搭建一个私有的Git服务器。 以下是阿里云服...

UtopiaOfArtoria的博客 5190

【Git】远程git服务器搭建

到目前为止已经有办法使用 Git 来完成日常工作。然而,为了使用 Git 协作功能,你还需要有远程的 Git 仓库。尽管在技术上可以从个人仓库进行推送(push)和拉取(pull)来修改内容,但不鼓励使用这种方法,因为一不留心就很容易弄混其他人的进度。此外,你希望你的合作者们即使在你的电脑未联机时亦能存取仓库 — 拥有一个更可靠的公用仓库十分有用。因此,与他人合作的最佳方法即是建立一个你与合作者们都有权利访问,且可从那里推送和拉取资料的共用仓库。架设一台 Git 服务器并不难。

C/C++软件工程师、嵌入式软件工程师、物联网研发工程师、C/C++讲师、物联网讲师、嵌入式讲师、鸿蒙讲师---欢迎大家一起交流(私信添加博主微信) 1524

Linux上搭建git服务器

第一步:安装git 命令:yum install git 敲下回车键自动安装,中间会有提示: 输入Y继续敲回车 检查是否安装成功:git --version 可以显示git版本信息,即表示git安装成功 第二步:创建git用户组 命令:groupadd git 创建成功不会有提醒,有异常提醒时检查命令是否正确。 第三步:创建git用户,并分配到git用户组中 命令:adduser git...

sun_luming的博客 1545

搭建 Windows 上 Apache + Git 服务器

在公司一直使用 SVN 作版本控制,不过 SVN 的 branch 是在过于灵活。我们所希望的只是一种简单的分支系统:各个分支能够完全独立开来,不会牵扯到复杂的 merge 操作。因此,决定搭建一个 Git 服务器。由于目前没有合适的 Linux 服务器,因此只能尝试在 Windows 上搭建。 在 Windows 上搭建 Git 服务器一般使用 SSL + putty + msysGit

Iteam项目组 Smith&Wesson(史密斯威森) 4748
上一篇: Git(八)远程仓库(Github)
下一篇: SVN 简介
夜未眠shm
博客等级 码龄14年 15粉丝 101原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值