Git远程版本库
===============================================================================
概述:
===============================================================================
Git 远程版本库
1.分布式版本控制系统
★基于的是网络协议
http,https,ssh,git
2.克隆操作
★git clone
★原始版本库存储在 refs/heads/
3.git 服务器
★协议
本地协议(local)、HTTP/HTTPS协议、SSH协议、Git协议
☉本地协议
URL:
/path/to/repo.git
file:///path/to/repo.git
☉Git协议:由git-daemon程序提供,监听在tcp的9418端口;仅支持“读”操作,无任何认证功能;
URL:
git://host/path/to/repo.git
git://host/~user/path/to/repo.git
☉SSH协议
演示1:本地协议
[root@node1 ~]# git clone file:///root/taotao/ /root/huihui Cloning into '/root/huihui'... remote: Enumerating objects: 32, done. remote: Counting objects: 100% (32/32), done. remote: Compressing objects: 100% (23/23), done. remote: Total 32 (delta 8), reused 0 (delta 0) Receiving objects: 100% (32/32), done. Resolving deltas: 100% (8/8), done. [root@node1 ~]# cd /root/huihui/ [root@node1 huihui]# ls first.sh INSTALL my.txt readmin second.sh subdir [root@node1 huihui]# cd .git/ [root@node1 .git]# ls branches config description HEAD hooks index info logs objects packed-refs refs [root@node1 .git]# tree refs/ refs/ ├── heads │ └── master #实际上只clone的master分支 ├── remotes #远程跟踪分支 │ └── origin │ └── HEAD #指向master分支 └── tags 4 directories, 2 files [root@node1 ~]# tree /root/taotao/.git/refs/ /root/taotao/.git/refs/ ├── heads │ ├── dev │ ├── fotfix │ └── master └── tags 2 directories, 3 files