分布式版本控制
多个开发人员协调工做
有效监听谁作的修改
本地以及远程操做html
git init //初始化本地仓库
git add //添加文件
git status //查看状态
git commit //提交
git push //推送到仓库
git pull //从远程仓库拉取数据
git clone //从远程仓库拷贝数据git
https://git-scm.com/downloads 自行安装下载app
在本地新建一个文件夹myapp,在命令行模式下cd到myapp文件夹下
在命令行中用touch命令建立index.html文件
第一次使用需配置用户名邮箱
git config --global user.name 'ChangJun'
git config --global user.email '779199489@qq.com'
git add index.html //添加一个文件
git status //在这个过程当中随时能够使用这个命令查看状态
git rm --cached index.html //删除添加的文件
git add . //上传全部文件
git commit -m ''//上传并备注分布式
使用git忽略不想上传的文件
分支的使用
主线与分支的合并
操做远程仓库命令行
touch .gitignore 建立git忽略文件,在其中写入要忽略的文件。忽略文件夹请使用文件夹名称
git branch login 建立分支
git checkout login 切换分支
touch login.html
git add . 上传到当前分支
git remote add origin 远程仓库地址
git remote 检查链接
git push -u origin master 上传版本控制