阿里云Ubuntu搭建git服务器
来源:互联网 发布:淘宝大学官网视频教程 编辑:程序博客网 时间:2024/06/05 11:18
本来之前配置过一次,后来忘了,这次一边配置一遍记录,以作备忘。
一. 服务器端配置
1.安装git
sudo apt-get install git
2.安装完成后配置git
git config --global user.name 'ndyd'git config --global user.email '844604030@qq.com'
3.添加一个git用户
sudo adduser git
4.切换到git用户,生成ssh key
su gitssh-keygen -t rsa -C '844604030@qq.com'
6.新建git仓库,并初始化
sodu mkdir /home/git/gittestgit init
7.新建一个测试文件a.txt 并提交到仓库
vim a.txt 随便写点什么git add a.txtgit commit a.txt -m ' 新增a.txt'
二. window7客户端配置
因为我的客户端已经安装好了git ,所以跳过安装这一步骤
1.生成ssh key
2.将客户端生成的ssh公钥复制到服务器端的ssh公钥中(客户端的在C:\Users\Administrator\.ssh中;Ubuntu中在当前用户目录的.ssh目录中)
3.win+R 输入cmd 打开命令行窗口
d:cd mygitgit initgit clone git@114.xxx.xxx.xxx:/home/gittest/.git
按照提示输入刚才设置的git用户的密码
连接成功,OK!
至此,git服务器就搭建成功了。
特别提示:默认的ssh连接端口是22 如果更改过ssh端口,则按照如下配置设置
1.进入.ssh目录,打开config(如果没有则新建一个)
#如果是以域名访问HostName xxx.comPort 1111#如果是以ip 访问Host "114.xxx.xxx.xxx"Port 111
0 0
- 阿里云Ubuntu搭建git服务器
- [李景山php] 阿里云服务器 ubuntu 搭建 git 服务器
- 阿里云git服务器搭建
- 一步步在阿里云的Ubuntu服务器上搭建自己的Git服务器
- 阿里云下搭建Git服务器
- 阿里云Centos7 搭建Git服务器仓库
- 在阿里云上搭建Git 服务器
- 阿里云 linux搭建git服务器
- 阿里云Ubuntu系统搭建SVN服务器
- 阿里云服务器搭建后台(Ubuntu)
- ubuntu搭建Git 服务器
- Ubuntu搭建Git服务器
- Ubuntu Git服务器搭建
- ubuntu搭建git服务器
- ubuntu git 服务器搭建
- ubuntu搭建git服务器
- Ubuntu搭建Git服务器
- ubuntu搭建git服务器
- day4,5-html
- 1036. Boys vs Girls (25)
- Leetcode-DSF-Trie-Backtrack
- CreateWaitableTimer和SetWaitableTimer函数(定时器)
- java内存模型
- 阿里云Ubuntu搭建git服务器
- Linux启动/停止/重启Mysql数据库的方法
- 从零学起vue(学习笔记2)
- MySQL主从同步(binlog方式)与主从切换
- Mac中为SourceTree设置代理登陆
- hadoop源码解析---INodeReference机制
- Android +camara
- Android系统设置命令— android.provider.Settings
- Maven打包war