安装git
yum -y install git
查看版本
git --version
添加git用户、为用户添加密码
useradd git
passwd git
passwd git
创建git创库
cd /home
mkdir git
cd git
ls
git init --bare test.git
chown -R git:git test.git
mkdir git
cd git
ls
git init --bare test.git
chown -R git:git test.git
下载windows的git https://git-scm.com/download/win
设置用户名和邮箱(不加””是获取)
git config --global user.name "名字"
git config --global user.email "邮箱地址"
右键本地仓库文件git bash here 跳出命令行
git clone git@地址:/home/git/test.git
加载git
cd test
git remote -v
git remote -v
初始化git
git init
查看git状态
git status
添加文件
更多参考添加 http://www.yiibai.com/git/git_add.html
git add . (.标识全部,或者直接输入文件名字)
查看git状态
git rm <fileName> (要移除的文件名字)
提交已经暂存的文件
git commit -m "这里添加注释"
提交到服务器
git push
从服务器更新
git pull
提交到某个分支
git push origin master(master为分支名称)
更新某个分支
git pull origin master(master为分支名称)