
Understanding Git Workflow: Merging, Rebase, and Fork Update
Explore the Git workflow essentials such as merging pull requests on GitHub, rebasing, and keeping your fork up-to-date. Learn how to collaborate efficiently using integration managers and maintain a clean repository structure.
Uploaded on | 1 Views
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
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 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?
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
The integration manager can inspect and pull in in your changes pull Developer Public Repository Blessed Repository Integration Manager Repository Developer Private Repository
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
You need to keep your fork up to date Developer Public Repository Blessed Repository Integration Manager Repository Developer Private Repository
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
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
Merge vs. Rebase HEAD E' HEAD feature HEAD M master C' HEAD HEAD E feature E feature HEAD HEAD D master D master C C B B A A git rebase master git merge feature
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.