86754 发表于 2016-7-21 09:15:52

Linux环境下git客户端的安装、配置及基本用法

一、安装git客户端

1
2
#yum源方式安装
yum -y install git




二、配置git客户端

1
2
git config --global user.name "xxx"
git config --global user.email "yyy"




三、如果是创建新的repository

1
2
3
4
5
6
git clone git@${gitaddr}:${username}/${projectname}.git
cd ${projectname}
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master




四、如果是将已存在的项目路径转为repository

1
2
3
4
5
6
7
8
cd existing_folder
git init
vim .gitignore
vim README.md
git remote add origin git@${gitaddr}:${username}/${projectname}.git
git add .
git commit
git push -u origin master





《完》

页: [1]
查看完整版本: Linux环境下git客户端的安装、配置及基本用法