ToB企服应用市场:ToB评测及商务社交产业平台

标题: 分布式版本控制体系 [打印本页]

作者: 忿忿的泥巴坨    时间: 3 天前
标题: 分布式版本控制体系
1.Git,GitHub,GitLab的区别

Git是一个开源的分布式版本控制体系,用于灵敏高效第处理任何或小或大的项目。是Linus Torvalds 为了帮助管理Linux内核开发而开发的一个开放源码的版本控制软件。
Github是在线的基于Git的代码托管服务。GitHub是2008年由Ruby on Rails编写而成。
GitHub同时提供付费账户和免费账户。这两种账户都可以创建公开的代码仓库,只有付费账户可以创建私有的代码仓库。Gitlab解决了这个问题,可以在上面创建免费的私人repo。
2.Git与SVN区别

GIT不仅仅是个版本控制体系,它也是个内容管理体系(CMS),工作管理体系等。
如果你是一个具有利用SVN配景的人,你需要做一定的头脑转换,来适应GIT提供的一些概念和特征。
2.1 Git与SVN区别

3 部署Git服务

创建git仓库
git-server上的操作:
  1. [rooteqfedu.com-]#yum install gitgit-core gitweb-y
  2. [rooteqfedu.com~]#useraddgit
  3. [rooteqfedu. com -] passwd git
  4. [rooteqfedu. com -] mkdir /git-root/
  5. [rooteqfedu. com -] cd /git-root/
  6. [rooteqfedu. com git-root]# git init --bare shell.git  ##shell名字可以改
  7. Initialized empty Git repository in /git-root/shell.git/
  8. 注意:
  9. git init 和 git init --bare 的区别:
  10. 使用——bare选项时,不再生成.git目录,而是只生成.git目录下面的版本历史记录文件,这些版本历史记录文件也不再存放在.git目录下面,而是直接存放在版本库的根目录下面.
  11. 用“git init”初始化的版本库用户也可以在该目录下执行所有git方面的操作。但别的用户在将更新push上来的时候容易出现冲突。
  12. 使用“git init——bare”方法创建一个所谓的裸仓库,之所以叫裸仓库是因为这个仓库只保存git历史提交的版本信息,而不允许用户在上面进行各种git操作,如果你硬要操作的话,只会得到下面的错误("This operation must be run in a work tree")这个就是最好把 远端仓库初始化成bare仓库的原因
  13. [rooteqfedu com git-root]# chown -R git: git shell.git
  14. [rooteqfedu. com git-root]# su -git
  15. [giteqfedu. com -] ssh-keygen -t rsa
  16. [giteqfedu. com -]s cd .ssh/
  17. [giteqfedu. com ssh]s cp id_rsa. pub authorized_keys
  18. [giteqfedu. com ssh]s vim authorized_key
  19. [giteqfedu. com ssh]$ logout
复制代码
git仓库测试
git-client上的操作
  1. [rooteqfedu.com~]#ssh-keygen
  2. [rooteqfedu.com-]#ssh-copy-id git@192.168.1.178
  3. [rooteqfedu.com-]#gitclone git@192.168.1.102:/git-root/shell.git
  4. [rooteqfedu. com ~] 1s
  5. rh shell
  6. [rooteqfedu com -] cd shell/
  7. [root@qfedu.comshell]#vimtest.sh
  8. [rooteqfedu. com shell]# git add test.sh
  9. [rooteqfedu com shell]# git config --global user.email "youeexample. com"
  10. [rooteqfedu. com shell]# git config --global user. name "Your Name"
  11. [rooteqfedu com shell]# git commit -m 'first commit'
  12. [master (root-commit) 33c5fbf] first commit
  13. 1 file changed, 2 insertions(+)
  14. create mode 100644 test1.sh
  15. [rooteqfedu. com shell]# git push origin master
  16. Counting objects: 3, done.
  17. Writing objects: 100% (3/3), 230 bytes | 0 bytes/s, done.
  18. Total 3 (delta 0), reused 0 (delta 0)
  19. To git@192.168.1.178:/git-root/shell.git
  20. * [new branch] master - master
复制代码
4. Git工作流程

一般工作流程如下:
Git的工作流程示意图:

5. git基本概念


6 git客户端安装利用

6.1 Git安装设置


6.2 git设置


6.2.1 Git用户信息


6.2.2 文本编辑器


6.2.3 差异分析工具


6.2.4 查看设置信息


6.3 Git利用

6.3.1 ssh链接


6.3.2 http链接











4、 辩说解决


7 Gitlab Server 部署

1、环境设置
关闭防火墙、SELinux
开启邮件服务

















用户天生公钥













摘自

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4