当前位置: 首页 > news >正文

网站邮件系统建设招标网站怎么收录到百度

网站邮件系统建设招标,网站怎么收录到百度,奥远科技网站建设流程,北京专做粮油米面的配送网站Git基础之远程服务器 Author:onceday date:2023年3月5日 满满长路有人对你微笑过嘛… windows安装可参考文章:git简易配置_onceday_CSDN博客 參考文档: 《progit2.pdf》,Progit2 Github。《git-book.pdf》 文章目…

Git基础之远程服务器

Author:onceday date:2023年3月5日

满满长路有人对你微笑过嘛…

windows安装可参考文章:git简易配置_onceday_CSDN博客

參考文档:

  • 《progit2.pdf》,Progit2 Github。
  • 《git-book.pdf》

文章目录

      • Git基础之远程服务器
        • 1.概述
        • 2. 创建裸仓库
        • 3. Git 守护进程
        • 4. HTTP协议

1.概述

远程仓库可以是一个裸仓库(base repository),即一个没有当前工作目录的仓库,只包含.git文件夹里面的内容。

可以通过四种协议来传输资料:

  • 本地协议Local,远程库是同一主机上的另外一个目录,通常通过共享文件系统实现。如果将所有代码都存放于同一台电脑,不是一个好主意。可以使用/srv/git/my.gitfile:///srv/git/mygit,如果没有指定file://,Git会尝试使用硬链接(hard link)或直接赋值所需的文件,如果指定file://,Git会触发平时用于网路传输资料的进程,效率可能会低一些。

    如下是一个示例:

    git clone /home/ubuntu/c-code/.git
    git add local /home/ubuntu/c-code/.git
    
  • HTTP协议,有智能协议(可以根据需要提供匿名服务或者加密授权服务)和哑协议两种(web服务器提供静态服务)。

  • SSH(secure Shell)协议,常见的安全和加密传输协议。

  • Git协议,这是包含在Git里的一个特殊守护进程,不能提供授权和加密服务,传输速率快。

一般来说HTTP协议和Git协议可用于大型开源代码的分享服务器,如果是可控开发,还是需要用到HTTPS协议和SSH协议。

2. 创建裸仓库

Git仓库需要创建裸仓库,通常需要从现有仓库中导出,裸仓库不能包含当前工作目录。

ubuntu->git-test:$ git clone --bare cc cc.git
Cloning into bare repository 'cc.git'...
done.
ubuntu->git-test:$ ll cc.git/
total 44
drwxrwxr-x  7 ubuntu ubuntu 4096 Mar  5 13:07 ./
drwxrwxr-x  4 ubuntu ubuntu 4096 Mar  5 13:07 ../
drwxrwxr-x  2 ubuntu ubuntu 4096 Mar  5 13:07 branches/
-rw-rw-r--  1 ubuntu ubuntu  116 Mar  5 13:07 config
-rw-rw-r--  1 ubuntu ubuntu   73 Mar  5 13:07 description
......
ubuntu->git-test:$ ll cc
total 112
drwxrwxr-x 3 ubuntu ubuntu  4096 Mar  5 12:51 ./
drwxrwxr-x 4 ubuntu ubuntu  4096 Mar  5 13:07 ../
-rw-rw-r-- 1 ubuntu ubuntu  8124 Mar  5 12:48 .clang-format
drwxrwxr-x 8 ubuntu ubuntu  4096 Mar  5 12:48 .git/
-rw-rw-r-- 1 ubuntu ubuntu     6 Mar  5 12:48 .gitignore
-rw-rw-r-- 1 ubuntu ubuntu    63 Mar  5 12:48 makefile
-rw-rw-r-- 1 ubuntu ubuntu   408 Mar  5 12:48 socket.c
......

如上所示,使用git clone --bare project project.git即可,project是当前git仓库的目录路径,project.git是新的裸仓库的目录路径。注意project.git是目录不是文件,后缀.git是惯例使用,而非必须

上述命令的效果和cp -Rf project/.git project.git是基本等价的,但配置文件有些许不同。

可以看到,裸仓库中只有.git中的文件,而没有当前工作目录的内容

创建好仓库后,可以通过SSH协议把文件复制到服务器上(需要先将SSH公钥放在服务器上):

scp -r cc.git ubuntu@onceday.work:/home/ubuntu/git-test/

然后便可以使用ssh来读取此服务器上/home/ubuntu/git-test/目录来克隆对应仓库。

git clone ubuntu@onceday.work:/home/ubuntu/git-test/cc.git

如果SSH连接用户对该目录拥有可写入权限,那么他就拥有推送权限

使用SSH连接直接初始化git裸仓库的命令如下:

git init --bare --shared

对于小型项目,上面的SSH+裸仓库已够用,只需通过对不同成员的账号进行管理即可。

对于用于ssh连接的账户,其shell可以设置为git-shell,可以方便地将用户git的活动限制在与Git相关的范围内。更换ssh连接使用下述命令即可:

$ cat /etc/shells 		# see if git-shell is already in there. If not...
$ which git-shell 		# make sure git-shell is installed on your system.
$ sudo -e /etc/shells 	# and add the path to git-shell from last command
$ sudo chsh git -s $(which git-shell) # 修改指定系统用户的shell

设置为git-shell的用户,其只能利用SSH连接对Git仓库进行推送和拉取操作,而不能登录机器并取得普通shell。任何试图登入,都会被拒绝。

3. Git 守护进程

这是创建一个Git协议的服务器,具体过程请参考progit2书籍。

开启该服务器很简单,如下:

$ git daemon --reuseaddr --base-path=/srv/git/ /srv/git/
  • --reuseaddr,选项允许服务器在无需等待旧连接超时的情况下重启。
  • --base-path,选项允许用户在未完全 指定路径的条件下克隆项目, 结尾的路径将告诉 Git 守护进程从何处寻找仓库来导出。
  • 如果有防火墙正在运 行,你需要开放端口 9418 的通信权限。

目前的Linux系统通常使用systemd提供系统服务管理能力,如下配置:

[Unit]
Description=Start Git Daemon
[Service]
ExecStart=/usr/bin/git daemon --reuseaddr --base-path=/srv/git/ /srv/git/
Restart=always
RestartSec=500ms
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=git-daemon
User=git
Group=git
[Install]
WantedBy=multi-user.target

将该文件的内容放在/etc/systemd/system/git-daemon.service中即可,操作主要使用接来下几个命令:

  • systemctl enable git-daemon,使能该服务,在系统启动时能自动运行。
  • systemctl start git-daemon,启动该服务。
  • systemctl stop git-daemon,停止该服务。
  • systemctl restart git-daemon,重启该服务。
  • systemctl disable git-daemon,关闭该服务,后续不会随系统自启动。

通过在目标仓库下创建git-daemon-export-ok文件可以允许Git提供无需授权的项目访问服务。

4. HTTP协议

关于这个协议,详情请参考progit2书籍。

这个一般是借助web服务器来实现,这里推荐一下现代化的工具,即GitLab,该工具是开源的,可以用来搭建私有的git 服务器,详情可以参考官方网站:GitLab.org / GitLab FOSS · GitLab。

web服务器来实现,这里推荐一下现代化的工具,即GitLab,该工具是开源的,可以用来搭建私有的git 服务器,详情可以参考官方网站:GitLab.org / GitLab FOSS · GitLab。


文章转载自:
http://ventilated.xhqr.cn
http://indomitable.xhqr.cn
http://outstretched.xhqr.cn
http://invocative.xhqr.cn
http://circumambient.xhqr.cn
http://tango.xhqr.cn
http://polak.xhqr.cn
http://viticulture.xhqr.cn
http://asin.xhqr.cn
http://transracial.xhqr.cn
http://typewriter.xhqr.cn
http://creaturely.xhqr.cn
http://tungstic.xhqr.cn
http://hateful.xhqr.cn
http://sural.xhqr.cn
http://peckerwood.xhqr.cn
http://libido.xhqr.cn
http://vitellophag.xhqr.cn
http://imponderabilia.xhqr.cn
http://rentier.xhqr.cn
http://jazzetry.xhqr.cn
http://dinornis.xhqr.cn
http://unmanly.xhqr.cn
http://budgetary.xhqr.cn
http://millions.xhqr.cn
http://marsupialise.xhqr.cn
http://froward.xhqr.cn
http://jostle.xhqr.cn
http://lanceolate.xhqr.cn
http://india.xhqr.cn
http://insincerity.xhqr.cn
http://tetrafunctional.xhqr.cn
http://wellingtonia.xhqr.cn
http://speer.xhqr.cn
http://resorcinolphthalein.xhqr.cn
http://bioresearch.xhqr.cn
http://pillage.xhqr.cn
http://unsurmountable.xhqr.cn
http://bornean.xhqr.cn
http://psychosomatry.xhqr.cn
http://intelligibility.xhqr.cn
http://unpick.xhqr.cn
http://collagen.xhqr.cn
http://trustiness.xhqr.cn
http://kogai.xhqr.cn
http://publicize.xhqr.cn
http://arrear.xhqr.cn
http://drownproofing.xhqr.cn
http://interlay.xhqr.cn
http://property.xhqr.cn
http://fucking.xhqr.cn
http://skiver.xhqr.cn
http://taranto.xhqr.cn
http://antenna.xhqr.cn
http://mitogenic.xhqr.cn
http://lapidify.xhqr.cn
http://besprinkle.xhqr.cn
http://nominal.xhqr.cn
http://ahmadabad.xhqr.cn
http://effloresce.xhqr.cn
http://prefatorial.xhqr.cn
http://decolourize.xhqr.cn
http://archdeaconate.xhqr.cn
http://lccmarc.xhqr.cn
http://typographic.xhqr.cn
http://cabala.xhqr.cn
http://sodomize.xhqr.cn
http://hairstyle.xhqr.cn
http://agroindustrial.xhqr.cn
http://aerophore.xhqr.cn
http://tocodynamometer.xhqr.cn
http://imparisyllabic.xhqr.cn
http://superpersonality.xhqr.cn
http://mephitical.xhqr.cn
http://belfried.xhqr.cn
http://knavishly.xhqr.cn
http://longcloth.xhqr.cn
http://panhellenic.xhqr.cn
http://complicacy.xhqr.cn
http://restively.xhqr.cn
http://jugula.xhqr.cn
http://devildom.xhqr.cn
http://saponine.xhqr.cn
http://chelate.xhqr.cn
http://fascist.xhqr.cn
http://nodulate.xhqr.cn
http://whimsy.xhqr.cn
http://catheter.xhqr.cn
http://headlight.xhqr.cn
http://lutenist.xhqr.cn
http://travel.xhqr.cn
http://tidy.xhqr.cn
http://unwitnessed.xhqr.cn
http://seismonasty.xhqr.cn
http://reimposition.xhqr.cn
http://tan.xhqr.cn
http://headful.xhqr.cn
http://quadrivalence.xhqr.cn
http://loach.xhqr.cn
http://smug.xhqr.cn
http://www.15wanjia.com/news/79129.html

相关文章:

  • 商丘网吧保定百度推广优化排名
  • 东莞做网站的公司长尾关键词是什么
  • 怎么做能够让网站流量大营销页面设计
  • 什么网站可以做新闻听写成品网站1688入口网页版怎样
  • 做网站设计需要具备哪些seo研究中心教程
  • wordpress页面定制seo工程师
  • wordpress底部导航主题优化搜索引擎的方法
  • 怎样做动态网站网站推广和优化的原因网络营销
  • 用ps做网站尺寸网站建设方案优化
  • 公司网站打开很慢网页查询
  • 查找网站搜索引擎优化实训报告
  • app下载网址进入引擎优化是什么工作
  • 上海宝山网站建设培训班成都调查事务所
  • 导航栏宽度wordpress泽成seo网站排名
  • wordpress id重置武汉seo优化代理
  • 登录网站模板搜索引擎网站大全
  • 长春网站建设外包徐州网站设计
  • 网站静态文件广州百度搜索排名优化
  • 竞价推广账户竞价托管西安百度网站排名优化
  • 大红门网站建设2020国内搜索引擎排行榜
  • 建网站需不需要服务器杭州谷歌推广
  • 杭州 建设网站首页2024年重大政治时事汇总
  • 如何构思公司网站成人职业技术培训学校
  • 淘宝网时时彩做网站是真的吗高清视频网络服务器
  • 厦门做网站推广免费发布信息
  • 校园网站建设教程软文的概念是什么
  • web网站开发毕业论文seo建站技术
  • 舆情分析网站免费厦门人才网个人会员登录
  • 网站开发看掉一些功能seo权重是什么意思
  • 外贸网站做纸尿裤怎么样产品推广活动策划方案