git安装配置
1.安装网址
官网:https://git-scm.com/download/win
镜像:https://npm.taobao.org/mirrors/git-for-windows/
2.安装步骤
一直下一步即可
3.配置
任意目录鼠标右键–Open Git Bash here
配置用户名
git config --global user.name "admin"
配置邮箱
git config --global user.email add@qq.com
git基本使用
1.初始化本地仓库
两种方式:
- git界面输入
git init
- 从远程仓库克隆
git clone 仓库地址
2.基本操作
查看远程仓库
git remote
设置远程仓库地址
git remote 仓库地址
拉取仓库的内容
git pull 仓库地址
将当前仓库内容保存到远程仓库
git push
添加到暂存区
git add 文件名称
提交指定文件到本地仓库
git commit -m"日志信息" 文件名称
提交所有文件到本地仓库
git commit -am"日志信息"
分支管理
查看分支
git branch
添加分支
git branch 分支名称
切换分支
git checkout 分支名称
合并分支
git merge 分支名称