git 初始化
git config --global user.name "用户名" //是自己自定义的用户名
git config --global user.email "用户邮箱" //自定义邮箱
git init
ssh初始化
ssh-keygen -t rsa -C "用户邮箱" //自定义邮箱
创建分支并推到线上
git branch dev //创建一个名为dev的本地分支
git checkout dev //切换到本地分支
git add .
git commit -m "...."
git push --set-upstream origin dev //创建线上分支,并设定puah默认为dev分支
git push
常规使用
git add .
git commit -m '....'
git pull --rebase
git push
测试服并正式服
//代码切到onlinne分支
git checkout online
//代码合并线上master
git merge orgin/master
//查看版本号
git tag
//版本号添加
git tag 版本号
//代码推送到服务器
git push
//版本号推送到服务器
git push --tags
//切换版本号
git checkout 版本号