远程git仓库进行连接:
git init创建本地仓库
创建本地仓库之后
git config --global user.name "xxx"
git config --global user.email "xxx"
git add文件
git commit -m "内容"
第一次与远程仓库建立联系需要
git remote add origin 远程仓库的路径
git push -u origin "master"//必须加-u,第二次之后就直接git push
命令总结
git merge合并分支
git branch分支名称 创建分支
git branch -v查看分支
git checkout 切换分支
git checkout -- 文件名 找回删除的文件
git clone 克隆一份代码到本地
git pull 下载更新的代码到本地
git push 提交到远程仓库
git tag标签
git push origin tags添加到远程
git tag -d删除本地标签
git tag origin :refs/tag标签 删除远程标签
git status 查看状态
git log查看日志
git add 添加文件暂存区
git commit添加本地仓库
git reat --m 回退到那个文件的密钥