Skip to content

Commit c8da013

Browse files
committed
docs: Merge changes from main branch
2 parents f99a80c + 1107f8d commit c8da013

File tree

3 files changed

+97
-91
lines changed

3 files changed

+97
-91
lines changed

.obsidian/workspace.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@
1111
"id": "08eecd3350f5b33e",
1212
"type": "leaf",
1313
"state": {
14-
"type": "empty",
15-
"state": {}
14+
"type": "markdown",
15+
"state": {
16+
"file": "docs/14-forking-over-code.md",
17+
"mode": "source",
18+
"source": false
19+
}
1620
}
1721
}
1822
]
@@ -81,6 +85,7 @@
8185
"state": {
8286
"type": "backlink",
8387
"state": {
88+
"file": "docs/14-forking-over-code.md",
8489
"collapseAll": false,
8590
"extraContext": false,
8691
"sortOrder": "alphabetical",
@@ -97,6 +102,7 @@
97102
"state": {
98103
"type": "outgoing-link",
99104
"state": {
105+
"file": "docs/14-forking-over-code.md",
100106
"linksCollapsed": false,
101107
"unlinkedCollapsed": true
102108
}
@@ -118,7 +124,9 @@
118124
"type": "leaf",
119125
"state": {
120126
"type": "outline",
121-
"state": {}
127+
"state": {
128+
"file": "docs/14-forking-over-code.md"
129+
}
122130
}
123131
}
124132
]
@@ -145,6 +153,7 @@
145153
"docs/14-forking-over-code.md",
146154
"docs/15-workflows.md",
147155
"CONTRIBUTE.md",
156+
"docs/98-command-line-extras.md",
148157
"assets/pasted-image-20240314105028.png",
149158
"assets/pasted-image-20240314102512.png",
150159
"assets/front-cover.svg",

CONTRIBUTE.md

Lines changed: 38 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,21 @@ Thank you for considering contributing to this tutorial repository!
66

77
[](CONTRIBUTE.md#support-questions)
88

9-
Please don't use the issue tracker for this. The issue tracker is a tool to address bugs and feature requests in Flask itself. Use one of the following resources for questions about using Flask or issues with your own code:
9+
Please don't use the issue tracker for this. The issue tracker is a tool to address bugs and feature requests for the project itself.
1010

11-
- The `#questions` channel on our Discord chat: [https://discord.gg/pallets](https://discord.gg/pallets)
12-
- Ask on [Stack Overflow](https://stackoverflow.com/questions/tagged/flask?tab=Frequent). Search with Google first using: `site:stackoverflow.com flask {search term, exception message, etc.}`
13-
- Ask on our [GitHub Discussions](https://github.com/pallets/flask/discussions) for long term discussion or larger questions.
11+
Use one of the following resources for questions about the project:
12+
13+
- Ask on our [GitHub Discussions](https://github.com/AdyGCode/Intro-to-Version-Control/discussions/) for long term discussion or larger questions.
1414

1515
## Reporting issues
1616

1717
[](https://github.com/pallets/flask/blob/main/CONTRIBUTING.rst#reporting-issues)
1818

1919
Include the following information in your post:
2020

21-
- Describe what you expected to happen.
22-
- If possible, include a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) to help us identify the issue. This also helps check that the issue is not with your own code.
23-
- Describe what actually happened. Include the full traceback if there was an exception.
24-
- List your Python and Flask versions. If possible, check if this issue is already fixed in the latest releases or the latest code in the repository.
21+
- Before reporting a problem, check if this issue is already fixed in the latest releases or the latest code in the repository.
22+
- Provide a title that gives a basic indicator of the yuou have. For example "Content missing: Chapter 7 No content", or "Grammar: Chapter 4"
23+
- Provide a possible solution, if you are able to do so.
2524

2625
## Submitting patches
2726

@@ -31,72 +30,51 @@ If there is not an open issue for what you want to submit, prefer opening one fo
3130

3231
Include the following in your patch:
3332

34-
- Use [Black](https://black.readthedocs.io/) to format your code. This and other tools will run automatically if you install [pre-commit](https://pre-commit.com/) using the instructions below.
35-
- Include tests if your patch adds or changes code. Make sure the test fails without your patch.
36-
- Update any relevant docs pages and docstrings. Docs pages and docstrings should be wrapped at 72 characters.
37-
- Add an entry in `CHANGES.rst`. Use the same style as other entries. Also include `.. versionchanged::` inline changelogs in relevant docstrings.
38-
39-
### First time setup using GitHub Codespaces
40-
41-
[](https://github.com/pallets/flask/blob/main/CONTRIBUTING.rst#first-time-setup-using-github-codespaces)
42-
43-
[GitHub Codespaces](https://docs.github.com/en/codespaces) creates a development environment that is already set up for the project. By default it opens in Visual Studio Code for the Web, but this can be changed in your GitHub profile settings to use Visual Studio Code or JetBrains PyCharm on your local computer.
44-
45-
- Make sure you have a [GitHub account](https://github.com/join).
46-
- From the project's repository page, click the green "Code" button and then "Create codespace on main".
47-
- The codespace will be set up, then Visual Studio Code will open. However, you'll need to wait a bit longer for the Python extension to be installed. You'll know it's ready when the terminal at the bottom shows that the virtualenv was activated.
48-
- Check out a branch and [start coding](https://github.com/pallets/flask/blob/main/CONTRIBUTING.rst#start-coding).
33+
- Update any relevant documents and images.
34+
- Add an entry in `CHANGELOG.md`. Use the same style as other entries.
4935

5036
### First time setup in your local environment
5137

5238
[](https://github.com/pallets/flask/blob/main/CONTRIBUTING.rst#first-time-setup-in-your-local-environment)
5339

5440
- Make sure you have a [GitHub account](https://github.com/join).
55-
41+
5642
- Download and install the [latest version of git](https://git-scm.com/downloads).
57-
43+
5844
- Configure git with your [username](https://docs.github.com/en/github/using-git/setting-your-username-in-git) and [email](https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address).
59-
60-
$ git config --global user.name 'your name'
61-
$ git config --global user.email 'your email'
62-
63-
- Fork Flask to your GitHub account by clicking the [Fork](https://github.com/pallets/flask/fork) button.
64-
45+
```bash
46+
git config --global user.name 'your name'
47+
git config --global user.email 'your email'
48+
```
49+
50+
- Fork this repository to your GitHub account by clicking the [Fork](https://github.com/AdyGCode/Intro-to-Version-Control/fork) button.
51+
6552
- [Clone](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#step-2-create-a-local-clone-of-your-fork) your fork locally, replacing `your-username` in the command below with your actual username.
66-
67-
$ git clone https://github.com/your-username/flask
68-
$ cd flask
69-
70-
- Create a virtualenv. Use the latest version of Python.
71-
72-
- Linux/macOS
73-
74-
$ python3 -m venv .venv
75-
$ . .venv/bin/activate
76-
77-
- Windows
78-
79-
> py -3 -m venv .venv
80-
> .venv\Scripts\activate
81-
82-
- Install the development dependencies, then install Flask in editable mode.
83-
84-
$ python -m pip install -U pip
85-
$ pip install -r requirements/dev.txt && pip install -e .
86-
87-
- Install the pre-commit hooks.
88-
89-
$ pre-commit install --install-hooks
90-
53+
```bash
54+
git clone https://github.com/your-username/Intro-to-Version-Control.git
55+
cd Intro-to-Version-Control
56+
```
57+
9158

92-
### Start coding
59+
### Start Editing and Documenting
9360

9461
[](https://github.com/pallets/flask/blob/main/CONTRIBUTING.rst#start-coding)
9562

96-
- Create a branch to identify the issue you would like to work on. If you're submitting a bug or documentation fix, branch off of the latest ".x" branch.
63+
- Create a branch to identify the issue you would like to work on using the following rules:
64+
65+
- If you are adding a new chapter, branch off the `dev` branch. Name your branch `feat/feature_name`.
66+
67+
68+
```bash
69+
git fetch origin
70+
git checkout -b feat/feature_name origin/2.0.x
71+
```
72+
73+
- If you're submitting a bug or documentation fix, branch off of the latest main branch. Name your fix `fix/`
74+
75+
76+
9777

98-
$ git fetch origin
99-
$ git checkout -b your-branch-name origin/2.0.x
10078

10179
If you're submitting a feature addition or change, branch off of the "main" branch.
10280

@@ -113,34 +91,6 @@ Include the following in your patch:
11391
$ git push --set-upstream origin your-branch-name
11492

11593

116-
### Running the tests
117-
118-
[](https://github.com/pallets/flask/blob/main/CONTRIBUTING.rst#running-the-tests)
119-
120-
Run the basic test suite with pytest.
121-
122-
$ pytest
123-
124-
This runs the tests for the current environment, which is usually sufficient. CI will run the full suite when you submit your pull request. You can run the full test suite with tox if you don't want to wait.
125-
126-
$ tox
127-
128-
### Running test coverage
129-
130-
[](https://github.com/pallets/flask/blob/main/CONTRIBUTING.rst#running-test-coverage)
131-
132-
Generating a report of lines that do not have test coverage can indicate where to start contributing. Run `pytest` using `coverage` and generate a report.
133-
134-
If you are using GitHub Codespaces, `coverage` is already installed so you can skip the installation command.
135-
136-
$ pip install coverage
137-
$ coverage run -m pytest
138-
$ coverage html
139-
140-
Open `htmlcov/index.html` in your browser to explore the report.
141-
142-
Read more about [coverage](https://coverage.readthedocs.io/).
143-
14494
### Building the docs
14595

14696
[](https://github.com/pallets/flask/blob/main/CONTRIBUTING.rst#building-the-docs)

docs/14-forking-over-code.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,52 @@ The concept of a fork is a GitHub feature. It basically clones the repository to
2020

2121
In return, GitHub maintains a link back to the original to allow collaboration on the project/repository.
2222

23+
## Why Fork
24+
25+
There are two main reasons:
26+
1. Go your own way
27+
2. Contribute
28+
29+
### Go your own way
30+
31+
This type of fork allows you freedom to take the project in a totally new direction.
32+
33+
It allows you to experiment, learn and grow.
34+
35+
It provides you with the opportunity to develop a new application or system based on the original, and then the ability to not look back!
36+
37+
Another part of this is that you still get the original project's updated code, bug fixes etc to be merged into your code at your discretion.
38+
39+
This type of fork gives you complete control of your project.
40+
41+
### Contribute
42+
43+
In the contribution type of fork, you are using the fork almost like a branch.
44+
45+
The big thing about this is that you only need read permissions to the original repo to start working.
46+
47+
## Forking in the Enterprise
48+
49+
Remember that forking is a GitHub feature. Other Git hosting solutions may have similar features.
50+
51+
Forking is common practice in open source development.
52+
53+
54+
## Comparing Forks v Branches
55+
56+
57+
| | Forks | Branches |
58+
| ----------------------------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
59+
| **Purpose** | Create a separate copy of a repository for significant changes or different directions | Develop new features or fix bugs without disrupting the main codebase |
60+
| **Relationship to the original codebase** | Completely independent repository | Linked to the original repository |
61+
| **Ownership** | Owned by the user who created them | Owned by the repository owner |
62+
| **Scope of changes** | Typically involve significant changes | Typically involve smaller changes |
63+
| **Collaboration** | Used to develop ideas in isolation from the main team | Used to develop ideas that the main team is working on |
64+
65+
Based on SSW.Rules "Do you know when to create a fork vs a branch".
66+
67+
SSW.Rules. (n.d.). _Git - Do you know when to create a fork vs a branch?_ [online] Available at: https://www.ssw.com.au/rules/fork-vs-branch/ [Accessed 14 Mar. 2024].
68+
2369
## How to Fork
2470

2571
Forking is done within the GitHub Web GUI.
@@ -30,3 +76,4 @@ The basic process is:
3076
- Read the ReadMe and any documentation on how to fork and contribute to the repository
3177
- Fork the repository (to your account)
3278
- Clone the repository to your local device
79+

0 commit comments

Comments
 (0)