Skip to content

Instantly share code, notes, and snippets.

@zachcr
Last active January 15, 2016 06:52
Show Gist options
  • Save zachcr/aee7c9186e241f3c8127 to your computer and use it in GitHub Desktop.
Save zachcr/aee7c9186e241f3c8127 to your computer and use it in GitHub Desktop.

Merge Request in aeris

links

Important command

  • git rebase

situation: develop branch has been updated by other developers, update your own branch by develop branch, let your code based on new code.
exp: _ rebase my branch, update new code from develop branch. _

// checkout to develop branch, pull new codes to local.
git checkout develop
git pull origin develop

// checkout back to [your branch], rebase new codes
git checkout zach
git rebase develop
// rebase from origin branch directly
git checkout zach
git fetch origin
git rebase origin/develop
  • git merge

situation: _ when you finish developing, merge your code to parent branch for testing or anything else._

Merge usually have some conflict, remember pull before merge.

// zach branch has new codes
git checkout develop
git merge zach

Rules

  • master branch: deploy branch, trigger for deploy scripts.
  • develop branch: develop code collection, trigger for testing scripts before deployment.
  • other branch: defined by developer.

do not merge any codes to master branch with command, please create a merge request from develop branch in https://gitlab.aeris.cn

origin commit map

 ...
  |---------------------------> trigger deployment processing
master                         
  |   \ (merge request)
  |   develop ---                        
  |      |       \ (merge)             
  |      |       zach [my develop branch]            
  |      |           |   
  |      |           | <- git commit -m "..."    
  |   develop      zach
  |      |  \        | \ (merge)
  |      |  issue#13 |  issue#232
  |      |     |     |     |       
 ...    ...   ...    ...   ...

local commit map

     ...              ...   
      |                |  origin develop
      |                |    /(push)
      |              develop
      |     (rebase)   |   \(merge)
origin-master ---->  develop \  
      |                |    zach --- origin zach  
      |                |      | (push)
      |                |      |
      |                |      |
     ...              ...    ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment