Server git development process

Source: Internet
Author: User

First, the cooperation process reference

Ii. Introduction of Branches

Master Branch: always in a stable state, this branch code can be used at any time to deploy. You are not allowed to submit code directly on this branch.
Develop branch: Development Branch, if you want to add a new feature, pull out a branch from the Master branch, and the branch name convention is develop/xxx

Third, the specific operation process 1, create a branch or pull a remote warehouse other branches created by others
//创建分支并提交到远程仓库git checkout -b develop/新分支名称 master //创建分支并切换到“develop/新分支名称”分支git push -u origin develop/新分支名称 //第一次提交需要加-u,这样可以绑定本地和远程分支关系,之后push和pull不用再指定后面“origin develop/新分支名称” //拉取远程仓库别人创建的分支git fetch origin git branch -a //查看所有分支,包括本地和远程git checkout -b develop/新分支 origin/develop/新分支 //“origin/develop/新分支”是远程仓库别人创建的分支
2, the development of new features merged master, and testing, to go live
//--no-ff会禁用Fast forward模式git merge --no-ff master
3, after the end of the line, you need to merge the development branch back to master
//合并到mastergit checkout mastergit merge --no-ff develop/xxx
Four, the use of Skill 1, configure shortcut commands
git config --global alias.st status  //git status 简化 git stgit config --global alias.co checkout //git checkout 简化 git cogit config --global alias.ci commit //git checkout 简化 git cigit config --global alias.br branch //git checkout 简化 git brgit config --global alias.lg "log --color --graph --pretty=format:‘%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset‘ --abbrev-commit"

Server git development process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.