本地初始换git仓库
git init
添加本地仓库
git add.
添加远程仓库到本地项目
git remote add origin https://github.com/************
添加提交信息/备注
git commit -m '需要填写的备注'
初次安装需要配置用户名和邮箱
git config --global user.name "zle1992"
git config --global user.email "625015879@qq.com"
项目拉取
git clone @gitxxxxxxx//项目地址
查看当前仓库地址
git remote -v
分支的操作
//查看当前所有分支
git branch -a
// 查看本地分支
git branch -l
//切换本地分支
git checkout dev
//创建本地分支
git checkout -b dev
//切换本地分支到项目分支
git checkout -b dev origin/dev
//删除本地分支
git checkout -D 分支名称
推送文件到远程仓库
git push
推送本地分支pre代码到远程prod分支
git push orgin pre:prod
拉取远程指定分支代码到当前代码
git pull origin <远程分支>:<当前分支>