Git Forked Repository Operations: Difference between revisions
Jump to navigation
Jump to search
Line 6: | Line 6: | ||
=Overview= | =Overview= | ||
For terminology, see [[Git_Concepts#Upstream_Repository|upstream]]/[[Git_Concepts#Base_Repository|base]] and [[Git_Concepts#Head_Repository|head]] repositories. | For terminology, see [[Git_Concepts#Upstream_Repository|upstream]]/[[Git_Concepts#Base_Repository|base]] and [[Git_Concepts#Head_Repository|head]] repositories. | ||
<font size=-2> | |||
┌───────────────────────────────┐ | |||
│ Upstream Origin │ | |||
│ ┌────┐ ┌────┐ │ | |||
│ │ │ │ │ │ | |||
│ └────┘ └────┘ │ | |||
└───────────────────────────────┘ | |||
GitHub | |||
Local Machine | |||
┌────┐ | |||
│ │ | |||
└────┘ | |||
Clone | |||
</font> | |||
=Fork= | =Fork= |
Revision as of 21:38, 1 November 2023
External
Internal
Overview
For terminology, see upstream/base and head repositories.
┌───────────────────────────────┐ │ Upstream Origin │ │ ┌────┐ ┌────┐ │ │ │ │ │ │ │ │ └────┘ └────┘ │ └───────────────────────────────┘ GitHub
Local Machine
┌────┐ │ │ └────┘ Clone
Fork
Go to GitHub UI and click on the "Fork" button at the top of the page.
Where should we work <project-name>?
Use your own "personal" organization.
Forking <original-org>/<project-name>
Clone
Clone as usual:
git clone git@github.example.com:ovidiu-feodorov/blue.git
PR Cycle
Send a PR
Push the commit in the head repository.
It will show up in the UI.
Click "Compare & pull request"
The UI will give you the default choice to send the PR against the base repository while "Create pull request". Use it.
Merge the PR
Upon approval ...
How to deal with the leftover branch?
Sync the Repository after the PR Merge
From the GitHub UI
In the fork repository UI, use "Fetch upstream" button. Then git pull
from the local clone.
CLI
How to deal with the leftover branch in the head repository?