Git安装与使用

Git仓库
1、安装Git
#yum install git
2、创建Git用户并设置密码
#useradd git
#passwd git
3、创建仓库
#su - git
#mkdir -r repos/app.git
#cd repos/app.git
初始化git仓库
#git -bare init

4、配置SSH免密码认证
5、客户端提交代码
安装Git
#yum install git
创建目录
#mkdir test;cd test
同步一下远程仓库
#git clone git@192.168.0.216:/home/git/repos/app.git
创建index.html文件
#cd app
echo "123" >>index.html
#git add .
#添加email和用户名:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
#git commit -m "1"
将代码提交到git仓库
#git push origin master

 

posted @ 2022-03-24 17:17  明辨之,笃行之,慎思之  Views(33)  Comments(0Edit  收藏  举报