linux suse 安装git,使用git,在Linux-Suse上安装

SVN属于集中式版本管理系统,CVS的前身,要求使用者和版本控制服务器要有网络。

Git属于分布式版本控制器,Linux创始人Linus反向工程了分布式版本控制的商业软件BitKeeper,主要优势:所有操作都可在本地完成,执行效率高,方便多人协同工作。

典型的组合:msysgit/Cygwin + TortoiseGit

Server端配置方式:

Setup a Git repository: server side

•Create an empty directory:

–$mkdir test.git

•Initialize a Git repository:

–$cd test.git

–$git init –bare –shared

•Write down the path of this repository:

–like: /home/git/test.git

–or: /home/jacoxu/git/test.git

Client端配置方式:

•Initialize a local repository:

–$cd workspace/test [the home directory of a project]

–$git init

•Create the first commit:

–$git add . [add all files to commit]

–$git commit -m “the first commit”

•Add the info of the remote repository:

–$git remote add origin ssh://git@192.168.0.1:47/home/jacoxu/git/test.git

•Upload the project to server:

–$git push origin master

–Password: jac**

•Or Download an existed remote repository:

–$git clone ssh://git@192.168.0.1:47/home/jacoxu/git/test.git

Others:

•设置用户名和密码:

–$git config –global user.name “jacoxu”

–$git config –global user.email jacoxu1987@gmail.com

•查看谁完成的提交:

–$git log –pretty==fuller

•查看当前有那些文件被修改了:

–$git status -s

•添加一个新的远程库:

–$git remote add jacoxu-remote ssh://root@192.168.9.236:22/u11/20140625Git-jacoxu/jacoxu-bak.git

•查看当前注册的远程库有哪些:

–$git remote -v

•Upload the project to server:

–$git push origin master

–Password: jac**

•Upload the project from server:

–$git pull origin master

–Password: jac**

•修改远程库URL地址:

–$git remote set-url jacoxu-remote ssh://git@192.168.0.1:47/home/jacoxu/git/test2.git

•修改远程库Name:

–$git remote rename jacoxu-remote jacoxu-remote2 (不建议操作默认远程库origin)

•Suse 11 服务器安装Git方法:

–Step.1: 下载git-1.7.9.4.tar.gz

–Step.2: 解压:$tar -xvf git-1.7.9.4.tar.gz

–Step.3: 进入解压后的目录:$cd ./git-1.7.9.4/

–Step.4: 执行如下指令:$./configure

–Step.5: 执行如下指令:$./make

可能会出现如下错误:

GIT_VERSION = 1.7.3.4

* new build flags or prefix

CC fast-import.o

In file included from builtin.h:6,

from fast-import.c:147:

cache.h:17:18: error: zlib.h: No such file or directory

–Step.6: 下载安装包zlib-devel-1.2.3-3.x86_64.rpm

–Step.7: 安装RPM:$sudo rpm -ivh zlib-devel-1.2.3-3.x86_64.rpm

–Step.8: 再次执行如下指令:$make && make install

–Step.9: 验证是否安装成功:$git –version

输出显示:git version 1.7.9.4

本地Shell进入服务器的SSH指令为:$ ssh root@192.168.9.236 -p 22

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值