In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Git remote version Library
=
Overview:
=
Git remote version Library
1. Distributed version control system
★ is based on network protocols.
Http,https,ssh,git
two。 Clone operation
★ git clone
★ original version inventory is stored in refs/heads/
3.git server
★ protocol
Local Protocol (local), HTTP/HTTPS Protocol, SSH Protocol, Git Protocol
☉ local protocol
URL:
/ path/to/repo.git
File:///path/to/repo.git
☉ Git protocol: provided by git-daemon program, listening on port 9418 of tcp; only "read" operation is supported, without any authentication function (open source projects are supported)
URL:
Git://host/path/to/repo.git
Git://host/~user/path/to/repo.git
☉ SSH protocol
URL:
Ssh:// [USER@] host [: port] / path/to/repo.git
Ssh:// [USER@] host [: port] / ~ USERNAME/path/to/repo.git
URL2:
[USER@] hostpath/torepo.git
☉ HTTP/HTTPS protocol
1.6.5 Murray: dumb http protocol
1.6.6protocols: intelligent http protocol (read / write / authentication)
URL:
Http://host/path/to/repo.git
Demo 1: local protocol
[root@node1 ~] # git clone file:///root/taotao/ / root/huihuiCloning into'/ root/huihui'...remote: Enumerating objects: 32, done.remote: Counting objects: 100% (32), done.remote: Compressing objects: 100% (23 delta 23), done.remote: Total 32 (delta 8), reused 0 (delta 0) Receiving objects: 100% (32 delta), done.Resolving deltas: 100% (8) Done. [root@node1 ~] # cd / root/huihui/ [root@node1 huihui] # lsfirst.sh INSTALL my.txt readmin second.sh subdir [root@node1 huihui] # cd .git / [root@node1 .git] # lsbranches config description HEAD hooks index info logs objects packed-refs refs [root@node1 .git] # tree refs/refs/ ├── heads │ └── master # actually only clone's master branch ├── remotes # remote tracking branch │ └── origin │ └── HEAD # points to the master branch └── tags4 directories 2 files [root@node1 ~] # tree / root/taotao/.git/refs//root/taotao/.git/refs/ ├── heads │ ├── dev │ ├── fotfix │ └── master └── tags2 directories, 3 files references remote version library
1. Distributed version control system
★ remote version Library
An entity defined in the configuration file
[remote "NAME"]
☉ consists of two parts:
Part one: URL
The second part: refspec, which defines the mapping relationship between the namespaces of one version library and other version libraries.
☉ syntax format:
+ source:destination (local branch and target branch of the map)
Refs/heads/NAME: local branch
Refs/remotes/NAME: remote tracking branch
Eg:
[remote "publish"]
Url= http://HOST/pub/repo_name.git
Push= + refs/heads/*:refs/remotes/origin/*
What it looks like:
Remote.publish.url
Remote.publish.push
The ★ git remote command manages the remote warehouse
Git protocol demo:
Install the git server on the node2 server and start the service
[root@node2~] # yum install git-daemon [root@node1 huihui] # rpm-ql git-daemon/usr/lib/systemd/system/git.socket # is an instantaneous daemon You can start / usr/lib/systemd/system/git@.service/usr/libexec/git-core/git-daemon/usr/share/doc/git-daemon-1.8.3.1/usr/share/doc/git-daemon-1.8.3.1/git-credential-cache--daemon.html/usr/share/doc/git-daemon-1.8.3.1/git-credential-cache--daemon.txt/usr/share/doc/git-daemon-1 directly. Storage location of 8.3.1/git-daemon.html/usr/share/doc/git-daemon-1.8.3.1/git-daemon.txt/usr/share/man/man1/git-credential-cache--daemon.1.gz/usr/share/man/man1/git-daemon.1.gz/var/lib/git # git warehouse Equivalent to the root directory [root@node2 ~] # cat / usr/lib/systemd/system/git@. Service [Unit] Description=Git Repositories Server DaemonDocumentation=man:git-daemon (1) [Service] User=nobody # modified-- the path after base-path can change the root directory of the git repository ExecStart=-/usr/libexec/git-core/git-daemon-- base-path=/var/lib/git-- export-all-- user- Path=public_git-- syslog-- inetd-- verboseStandardInput=socket# startup service And check port 9418 [root@node2 ~] # systemctl start git.socket [root@node2 ~] # ss-tnl of tcp | grep 9418LISTEN 0128:: 9418:: *
two。 Create a naked warehouse under the git root on the nod2 remote server without the need for a working directory
[root@node2 ~] # cd / var/lib/git/ [root@node2 git] # git init-- bare myproject.git initializes the empty Git version library at / var/lib/git/myproject.git/ [root@node2 git] # ls myproject.git/branches config description HEAD hooks info objects refs
3. Clone the remote repository of the node2 node in the node1 node
[root@node1] # git clone git://192.168.0.102/myproject.gitCloning into 'myproject'...warning: You appear to have cloned an empty repository. [root@node1 myproject] # ls-a. .. .git [root@node1 myproject] # git config-luser.name=wataouser.email=wangzhangtao@pachiratech.comcore.repositoryformatversion=0core.filemode=truecore.bare=falsecore.logallrefupdates=trueremote.origin.url=git://192.168.0.108/myproject.gitremote.origin.fetch=+refs/heads/*:refs/remotes/origin/*branch.master.remote=originbranch.master.merge=refs/heads/master
Http protocol demo:
1. Install httpd and make sure there are alias,env and cgi modules
[root@node2~] # yum install httpd# ensures that there are three modules [root@node2~] # httpd-M | grep-Ei "\
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.