ubuntu 14.04搭建git服务器
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了ubuntu 14.04搭建git服务器,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2440字,纯文字阅读大概需要4分钟。
内容图文
![ubuntu 14.04搭建git服务器](/upload/InfoBanner/zyjiaocheng/963/075cdb416ea14f6f9271b171ab440a03.jpg)
想在单位内部署git服务器,因此,特别记录部署相关的安装步骤
1. 安装
root@ros-OptiPlex-3050:~# sudo apt-get install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch
git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
git
0 upgraded, 1 newly installed, 0 to remove and 179 not upgraded.
Need to get 3,176 kB of archives.
After this operation, 24.1 MB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu xenial-updates/main amd64 git amd64 1:2.7.4-0ubuntu1.6 [3,176 kB]
Fetched 3,176 kB in 7s (399 kB/s)
Selecting previously unselected package git.
(Reading database ... 258511 files and directories currently installed.)
Preparing to unpack .../git_1%3a2.7.4-0ubuntu1.6_amd64.deb ...
Unpacking git (1:2.7.4-0ubuntu1.6) ...
Setting up git (1:2.7.4-0ubuntu1.6) ...
2. 添加用户
root@ros-OptiPlex-3050:~# sudo adduser git
Adding user `git' ...
Adding new group `git' (1003) ...
Adding new user `git' (1003) with group `git' ...
The home directory `/home/git' already exists. Not copying from `/etc/skel'.
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for git
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n]
root@ros-OptiPlex-3050:~# ll /home/git/
total 32
drwxr-xr-x 2 git git 4096 7月 12 09:33 ./
drwxr-xr-x 6 root root 4096 7月 12 09:33 ../
-rw-r--r-- 1 git git 220 7月 12 09:33 .bash_logout
-rw-r--r-- 1 git git 3771 7月 12 09:33 .bashrc
-rw-r--r-- 1 git git 8980 7月 12 09:33 examples.desktop
-rw-r--r-- 1 git git 655 7月 12 09:33 .profile
3. 在/home/git目录下放置证书
4. 初始化git库
root@ros-OptiPlex-3050:/home/git# git init --bare sample.git
Initialized empty Git repository in /home/git/sample.git/
root@ros-OptiPlex-3050:/home/git# ls
examples.desktop sample.git
5. 禁用shell
root@ros-OptiPlex-3050:/home/git# sudo chown -R git:git sample.git
root@ros-OptiPlex-3050:/home/git# git:x:1001:1001:,,,:/home/git:/usr/bin/git-shell
-bash: git:x:1001:1001:,,,:/home/git:/usr/bin/git-shell: No such file or directory
6.其他
内容总结
以上是互联网集市为您收集整理的ubuntu 14.04搭建git服务器全部内容,希望文章能够帮你解决ubuntu 14.04搭建git服务器所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。