Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorjacobslusser <jslusser.mobile@gmail.com>2021-06-04 08:36:48 +0300
committerGitHub <noreply@github.com>2021-06-04 08:36:48 +0300
commit5fae4d619c9b7cf94dfe7a324014c1704b28c15f (patch)
tree2d2da1a5cb0f64de0508cd6603bda15bb8f68be7 /docs
parent1545d7baae70ae65a5a1618d6627f9c4fd5a7027 (diff)
Added instructions to the documentation for forking the main repo. (#33098)
* Added instructions to the documentation for forking the main repo. * Added a link to basic GitHub flow for forking repos. * Fixed a broken section link. * Added additional information and link for fetching upstream changes.
Diffstat (limited to 'docs')
-rw-r--r--docs/BuildFromSource.md47
1 files changed, 41 insertions, 6 deletions
diff --git a/docs/BuildFromSource.md b/docs/BuildFromSource.md
index 22ebed7675..dc80873ffa 100644
--- a/docs/BuildFromSource.md
+++ b/docs/BuildFromSource.md
@@ -1,6 +1,6 @@
# Build ASP.NET Core from Source
-This document outlines how to build the source in the aspnetcore repo locally for development purposes.
+This document outlines how to build the source in the `aspnetcore` repo locally for development purposes.
For more info on issues related to build infrastructure and ongoing work, see <https://github.com/dotnet/aspnetcore/labels/area-infrastructure>.
@@ -9,17 +9,24 @@ For more info on issues related to build infrastructure and ongoing work, see <h
This tutorial assumes that you are familiar with:
- Git
+- The basics of [forking and contributing to GitHub projects](https://guides.github.com/activities/forking/)
- Command line fundamentals in your operating system of choice
-## Step 1: Clone the source code
+## Step 1: Getting the source code
+
+Development is done in your own repo, not directly against the official `dotnet/aspnetcore` repo. To create your own fork, click the __Fork__ button from our GitHub repo as a signed-in user and your own fork will be created.
+
+> :bulb: All other steps below will be against your fork of the aspnetcore repo (e.g. `YOUR_USERNAME/aspnetcore`), not the official `dotnet/aspnetcore` repo.
+
+### Cloning your repo locally
ASP.NET Core uses git submodules to include the source from a few other projects. In order to pull the sources of the these submodules when cloning the repo, be sure to pass the `--recursive` flag to the `git clone` command.
```powershell
-git clone --recursive https://github.com/dotnet/aspnetcore
+git clone --recursive https://github.com/YOUR_USERNAME/aspnetcore
```
-If you've already cloned the aspnetcore repo without fetching submodule sources, you can fetch them after cloning by running the following command.
+If you've already cloned the `aspnetcore` repo without fetching submodule sources, you can fetch them after cloning by running the following command.
```powershell
git submodule update --init --recursive
@@ -27,9 +34,37 @@ git submodule update --init --recursive
> :bulb: Some ISPs have been know to use web filtering software that has caused issues with git repository cloning, if you experience issues cloning this repo please review <https://help.github.com/en/github/authenticating-to-github/using-ssh-over-the-https-port>.
+### Tracking remote changes
+
+The first time you clone your repo locally, you'll want to set an additional Git remote back to the official repo so that you can periodically refresh your repo with the latest official changes.
+
+```powershell
+git remote add upstream https://github.com/dotnet/aspnetcore.git
+```
+
+You can verify the `upstream` remote has been set correctly.
+
+```powershell
+git remote -v
+> origin https://github.com/YOUR_USERNAME/aspnetcore (fetch)
+> origin https://github.com/YOUR_USERNAME/aspnetcore (push)
+> upstream https://github.com/dotnet/aspnetcore.git (fetch)
+> upstream https://github.com/dotnet/aspnetcore.git (push)
+```
+
+Once configured, the easiest way to keep your repository current with the upstream repository is using GitHub's feature to [fetch upstream changes](https://github.blog/changelog/2021-05-06-sync-an-out-of-date-branch-of-a-fork-from-the-web/).
+
+### Branching
+
+If you ultimately want to be able to submit a PR back to the project or be able to periodically refresh your `main` branch with the latest code changes, you'll want to do all your work on a new branch.
+
+```powershell
+git checkout -b NEW_BRANCH
+```
+
## Step 2: Install pre-requisites
-Developing in the aspnetcore repo requires some additional tools to build the source code and run integration tests.
+Developing in the `aspnetcore` repo requires some additional tools to build the source code and run integration tests.
### On Windows
@@ -234,7 +269,7 @@ code .
### Building on command-line
-When developing in VS Code, you'll need to use the `build.cmd` or `build.sh` scripts in order to build the project. You can learn more about the command line options available, check out [the section below](using-dotnet-on-command-line-in-this-repo).
+When developing in VS Code, you'll need to use the `build.cmd` or `build.sh` scripts in order to build the project. You can learn more about the command line options available, check out [the section below](#using-dotnet-on-command-line-in-this-repo).
> :warning: Most of the time, you will want to build a particular project instead of the entire repository. It's faster and will allow you to focus on a particular area of concern. If you need to build all code in the repo for any reason, you can use the top-level build script located under `eng\build.cmd` or `eng\build.sh`.