搭建Git本地服务器
来源:互联网 发布:c语言怎么样 编辑:程序博客网 时间:2024/05/16 07:50
参考文章:http://www.ossxp.com/doc/git/gitolite.html
当前任务,学习中... 公司小范围用法: 服务器上做的:
- 在服务器上建立一个用户,这里命名为git。 ubuntu下: useradd git —— passwd git 1 (改密码为1)
- 找个目录,建立空仓库 git --bare init 。 ubuntu下: cd /opt —— mkdir git —— git --bare init
- 建立文件夹project.git (名字随便取,这里取project,以后别人git clone时就会生成project文件夹)。
- 再建立一个文件夹.ssh,用来存入需要访问的成员的 ssh-keygen
————————————————————————————————————————
项目成员机上要做的:
- 生成本机的ssh-keygen:直接运行 ssh-keygen ,回车,回车。生成的密钥会在window下: “C:\Documents and Settings\userName\.ssh”,有两个文件,复制id_rsa.pub的内容给服务器管理员(邮件或直接QQ吧!)。
- 轮到服务器管理员:在.ssh文件夹下建立 id_rsa.pub 文件 , 或直接:cat ~/opt/.ssh/id_rsa.pub 加成员的id_rsa.pub内容 (反正添加到这个文件后面就可以)
- 下面小组成员应该可以正常访问服务器了(对了,在此之前,需要安装ssh服务器 : apt-get install ssh)
项目组老大要做的:
- 做一个基本项目原型,供项目成员克隆下载 , 将已有文件推送到git服务器上
- 新建文件夹,git init 初始化git 。
- git add * 将所有文件加入git 监控 ,可以用git status 查看监控状态
- git commit -m "你的提交说明"
- git remote add origin git@yourServerIP:/opt/git/project.git (这里是将远程git服务器命名成origin,方便以后使用,名字随便改)
- 推送到服务器 git push origin master 意思是 : git 推送 到 服务器目录 哪个分支—master 。 至此,完毕。
项目成员基本步骤:
- git clone git@serverIP:/opt/git/project.git 完成仓库克隆工作
- 做该做的事,
- git commit -a -m "你的提交说明"
- git remote add origin git@yourServerIP:/opt/git/project.git
- git push origin master 上传分支。
当然,还有更多的分支使用技巧...请参考以下书籍:
Pro.Git-zh_CN
还有一本:
Git Community Book 中文版
下面是本人在使用git过程遇到的问题:
- git服务器把文件藏在哪了呢?
答:在objects文件夹下。查看文件的方式:不用进入目录下,直接用git cat-file -p 短目录名(如0e)+文件名前n位即可
0 0
- 搭建Git本地服务器
- 搭建Git本地服务器
- 搭建Git本地服务器
- git本地服务器搭建
- 搭建Git本地服务器
- Git搭建本地服务器
- 搭建git本地服务器
- git 分支 本地服务器搭建
- 搭建本地git到服务器
- Bonobo Git Server搭建本地Git服务器
- Ubuntu上搭建本地Git服务器
- win7本地搭建git ssh服务器
- Window系统下搭建GIT本地服务器
- Window系统下搭建GIT本地服务器
- Git本地服务器搭建及使用详解
- 本地Git服务器的搭建及使用
- Bonobo Git Server搭建本地Git服务器(Windows 下)
- Windows+Git+COPSSH+TortoiseGit搭建本地Git服务器(史上最全)
- 字符串函数strcpy,strcat,memcpy的实现
- 利用自定义的 ClassLoader 加密 Java Class 文件
- Fiddler
- PPT是魔鬼:老板爱看 员工受累
- java 数据结构之单链表
- 搭建Git本地服务器
- OkHttp使用教程
- 5月英语成长记
- web应用缓慢故障分析
- Nginx RTMP 模块 nginx-rtmp-module 指令详解
- JS函数声明和函数表达式的区别
- java 动态代理实现
- python用训练好的model分类
- 面向项目(十二)—— 提高程序的鲁棒性