Lecture 8 Integration Manager Workflow and Basic Rebasing Last Time - - PowerPoint PPT Presentation

lecture 8 integration manager workflow and basic rebasing
SMART_READER_LITE
LIVE PREVIEW

Lecture 8 Integration Manager Workflow and Basic Rebasing Last Time - - PowerPoint PPT Presentation

Sign in on the attendance sheet! Lecture 8 Integration Manager Workflow and Basic Rebasing Last Time Remote tracking branches Introduced centralized Git workflow Made a pull request Github/ The cloud Local Computer Today


slide-1
SLIDE 1

Lecture 8 Integration Manager Workflow and Basic Rebasing

Sign in on the attendance sheet!

slide-2
SLIDE 2

Last Time

  • Remote tracking branches
  • Introduced centralized Git workflow
  • Made a pull request

Local Computer Github/ “The cloud”

slide-3
SLIDE 3

Today

  • What happens when we merge pull requests
  • How we keep our fork up to date
  • What is rebase and what does it have to do with any of this?
slide-4
SLIDE 4

Merging a Pull Request on Github

  • Pull request into blessed-repo:master from remote-repo:my-feature
  • Clicking the merge pull request button is equivalent to executing the

following commands in the blessed-repo repository itself:

Note that we can’t actually execute commands in the remote repository but Github can

$ git checkout master $ git remote add remote-repo https://github.com/user/remote-repo.git $ git fetch remote-repo $ git merge --no-ff remote-repo/my-feature

Must merge cleanly! PR interface will not allow merge until conflicts are resolved

slide-5
SLIDE 5

The integration manager can inspect and pull in in your changes

Developer Public Repository Developer Private Repository Integration Manager Repository Blessed Repository

slide-6
SLIDE 6

Merging a Pull Request Manually

  • Pull request into blessed-repo:master from remote-repo:my-feature
  • In the “integration manager’s” clone of blessed-repo:

$ git checkout master $ git pull $ git remote add remote-repo https://github.com/user/remote-repo.git $ git fetch remote-repo $ git merge --no-ff remote-repo/my-feature $ git push origin master

slide-7
SLIDE 7

You need to keep your fork up to date

Developer Public Repository Developer Private Repository Integration Manager Repository Blessed Repository

slide-8
SLIDE 8

You need to keep your fork up to date

In the private developer repo $ git remote add upstream https://github.com/autolab/Autolab.git $ git fetch upstream $ git checkout master $ git merge upstream/master $ git push origin master

slide-9
SLIDE 9

Rebasing

  • Rebasing rewrites your git history,

replaying the diffs of your commits

  • Useful as an alternative to merging

when you want to keep history neat

slide-10
SLIDE 10

Merge vs. Rebase

A B D C E M

master feature HEAD git merge feature master HEAD

A B D C E

master feature HEAD git rebase master

C' E'

HEAD HEAD HEAD feature HEAD

slide-11
SLIDE 11

Activity/Homework

Rebase the changes you made a PR for last week on top of the new upstream/master and push to your branch. Your PR should update automatically.