git ---- workflow

1, a centralized workflow

 

1.1 Example:

1.1.1 was initialized good central warehouse

The establishment of a unified repository on github

1.1.2 central repository for all cloning

 

1.2.3 Xiaoming development function

Create a file in the local git

1.2.4 Development Features red

Create a file in the local git

1.2.5 Xiaoming publishing

git add filename

git commit -m "Description"

git push origin master

1.2.6 Little Red publishing

If the red as Bob, like direct push will complain, which avoids formal submission red overwritten. She had to pull Xiaoming update to her local warehouse merge her local changes, then try again. If the remote repository and local repository files, like, git push will be an immediate success;

git pull origin maste (if you and some local directory (it should be their new directory) and directory name of the remote repository, or file name, this time will be overwritten), personal feeling, in between their own pull, most good will alone save a local code

git push origin master (like do not need to add and commit, because previously submitted (add / commit), now only need to push, if not add before, still need to add.commit)

The best of each individual to create a separate branch. If there is a large merger, then, in a separate combined master in

 

2, feature branch workflow

2.1 Example

2.1.1 Log function began to develop red

First, create a branch

创建分支:      $ git branch branch name

查看所有的分支:  $ git branch
切换分支:      $  git checkout branch name
Push code to the remote repository $ git push origin zy (branch name)
 
 
 

 

Guess you like

Origin www.cnblogs.com/yanxiaoge/p/10993904.html