git仓库创建及基本使用

创建git用户
useradd git
passwd git
创建目录
mkdir /home/git/repos/app.git/ -p
初始化目录
cd /home/git/repos/app.git/
git --bare init
将主机的app.git权限更改给git用户
chown -R git.git app.git
其他主机clone下app.git
git clone [email protected]:/home/git/repos/app.git
在其他主机目录创建文件index.html
首先提交到本机仓库
git add .
查看提交状态
git status
把修改了的添加到缓存区
git add <filename>
git add *
提交改动
git commit -m "提交信息"
推送到远程仓库
git push origin master
git remote add origin <server>

猜你喜欢

转载自www.cnblogs.com/xiongyoutom/p/12449113.html