Skip to content

Commit 2bbe7f5

Browse files
authored
Update forking_workflow.md
1 parent 8ef429c commit 2bbe7f5

File tree

1 file changed

+32
-18
lines changed

1 file changed

+32
-18
lines changed

forking_workflow.md

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,45 @@
11
# Forking Workflow
22

33
## Intro
4-
Welcome to the Forking Workflow tutorial! Here we will demonstrate a workflow that allows for collaborative development of a shared code repository. It has the features:
5-
- individual developers "fork" some shared repository
6-
- development occurs on individual, forked remote/local repositories
7-
- individual development gets integrated into shared repository through Pull Requests (PRs)
4+
Welcome to the Forking Workflow tutorial! Here we will demonstrate a workflow that allows for collaborative development of a shared code repository. In brief, the "Forking Workflow" can be described as:
5+
- Individual developers "fork" some shared repository
6+
- Development occurs on individual, forked repositories
7+
- Individual development gets integrated into shared repository through Pull Requests (PRs)
8+
9+
10+
The Forking Workflow involves 3 different repositories:
11+
- **Upstream, or "Parent" Repo**: This remote repository belongs to some organization that is not the individual developer. Maintainers of this repository control who gets to make changes, and can review/accept/decline and incoming changes through pull requests.
12+
- **Origin, or "Forked Remote" Repo**: This remote repository is a fork of the "Parent", and belongs to the individual developer. Any changes made here are separate from the parent. The individual developer can create pull requests from this repo to the parent.
13+
- **Local Repo**: This is the local repo on the device of the individual developer, and it is where development occurs. It is a clone of the "Forked Remote" repo.
14+
815
![featured_hud478d74d48d19bfd1c1c03fc398c8033_312322_720x0_resize_lanczos_3](https://user-images.githubusercontent.com/97498519/176066441-ac8fadbf-a6c3-4dd1-b137-d59274bdcb0e.png)
916

10-
**Honorable mention**: There is a separate workflow that you may encounter which uses branches within the same repository to achieve similar affects. There is a tutorial for that as well: https://github.com/pqz317/cnc_github_tutorial/blob/main/feature_branch_workflow.md
17+
18+
**Note**: There is a separate workflow that you may encounter which uses branches within the same repository to achieve similar affects. There is a tutorial for that as well: https://github.com/pqz317/cnc_github_tutorial/blob/main/feature_branch_workflow.md
1119

1220
The steps through this demo are:
13-
1. Fork this repo on Github
14-
2. Clone this forked repo to a local repo
21+
1. Fork this "Parent" Repo to create a "Forked" Repo
22+
2. Clone the "Forked" Repo to create a Local Repo
1523
3. Make local changes
16-
4. Push your changes to your forked repo on Github
17-
5. Creating a Pull Request to integrate your changes into the "parent" repo
18-
6. Fetching changes from the parent repo to your local repo
19-
7. (Potentially) resolving
24+
4. Push your changes to your "Forked" repo on Github
25+
5. Create a Pull Request to integrate your changes into the "Parent" repo
26+
6. Fetch changes from the parent repo to your local repo
27+
7. (Potentially) Resolve merge conflicts
2028

21-
## 1. Forking a Repo
22-
If there is an existing remote repository you'd like to start development on, usually the first thing to do would be to create a "fork" of this repository for yourself. This provides you with a repository on Github that is a clone of its "parent", where you can do any type of development and testing on without affecting the parent.
23-
Fork this repo with
29+
## 1. Fork this "Parent" Repo to create a "Forked" Repo
30+
Say there is an existing remote repository that belongs to some organization, and you'd like to start development on it, usually the first thing to do would be to create a "fork" of this repository for yourself. This provides you with a repository on Github that is a clone of its "parent", where you can do any type of development and testing on without affecting the parent.
2431

25-
For this repo, the command to run locally will be:
32+
For this tutorial, you can fork this repo with the "fork" button on Github:
33+
<img width="1000" alt="Screen Shot 2022-06-27 at 7 00 30 PM" src="https://user-images.githubusercontent.com/97498519/176095938-ef63421c-a878-426b-bcfb-2a3e736d3b2c.png">
34+
You have now successfully "forked" the `cnc_github_tutorial` repo, and created a new repo that is `<YOUR_USERNAME>/cnc_github_tutorial`
35+
36+
37+
## 2. Clone the "Forked" Repo to create a Local Repo
38+
Your "forked" repo still only lives on Github, so to obtain a local copy of it and begin developing, run
2639
```
27-
git clone https://github.com/pqz317/cnc_github_tutorial.git
40+
git clone https://github.com/<YOUR_USERNAME>/cnc_github_tutorial.git
2841
```
29-
The URL can always be found under the "Clone" Section of the Github page of the repo:
42+
The URL can always be found under the "Clone" Section of the Github page of your "forked" repo:
3043
<img width="800" alt="Screen Shot 2022-06-27 at 9 42 45 AM" src="https://user-images.githubusercontent.com/97498519/175992957-a6794a57-b257-474e-b2ef-73859bfe40d2.png">
3144
Once cloned, you should have a directory `cnc_github_tutorial` in your local filesystem. Run `git status` to verify that the directory is a git repository, and that you are on the `main` branch. An example output:
3245
```
@@ -36,7 +49,8 @@ Your branch is up to date with 'origin/main'.
3649
3750
nothing to commit, working tree clean
3851
```
39-
You have now successfully cloned a repo!
52+
53+
4054

4155
## 2. Creating a new local branch
4256
One general convention is to keep your local `main` branch tracking the `main` in the remote, and perform any development on a different branch

0 commit comments

Comments
 (0)