Skip to content

Using git for the Integration Candidate Merge Process

Gerardo E. Cruz-Ortiz edited this page Sep 16, 2020 · 2 revisions

Always reset the integration-candidate before starting a new cycle:

  1. git checkout main
  2. git pull Pull on the main branch to confirm that your local main matches the remote

Method 1, create a new local branch and force push

  1. git branch -D integration-candidate Delete your local integration-candidate. BE CAREFUL
  2. git checkout integration-candidate. This should be in line with main
  3. git log inspect that main, integration-candidate, AND remote/main are all in line
  4. git branch -u origin/integration-candidate This "connects" your local integration-candidate with the remote on GitHub
  5. git status check that your local integration-candidate is connected to the remote. They have possibly have diverged.
  6. git push This will probably be rejected. You'll get an error similar to the one below
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  1. git push --force, you'll get a confirmation like the one below
+ 576910b...ffb30d8 integration-candidate -> integration-candidate (forced update)

Method 2, rebase your local integration candidate on top of main

  1. git checkout integration-candidate. This should be in line with main
  2. git pull
  3. git rebase main Bring integration candidate up to main,
  4. git status check that your local integration-candidate is connected to the remote. They have possibly have diverged.
  5. git push This might be rejected. You'll get an error similar to the one below
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Clone this wiki locally