1
0
mirror of synced 2025-12-22 11:26:57 -05:00

Document features and changes for phase 2.5 of master/main transition (#15745)

This commit is contained in:
Matt Pollard
2020-10-02 01:43:01 +02:00
committed by GitHub
parent 16dd6b4654
commit aa3a4edb62
80 changed files with 206 additions and 191 deletions

View File

@@ -10,28 +10,30 @@ versions:
---
### Introducing branches
### About branches
Branches allow you to develop features, fix bugs, or safely experiment with new ideas in a contained area of your repository.
You always create a branch from an existing branch. Typically, you might create a new branch from the default branch of your repository. You can then work on this new branch in isolation from changes that other people are making to the repository. A branch you create to build a feature is commonly referred to as a feature branch or topic branch. For more information, see "[Creating and deleting branches within your repository](/articles/creating-and-deleting-branches-within-your-repository/)."
You can also use a branch to publish a {% data variables.product.prodname_pages %} site. For more information, see "[What is {% data variables.product.prodname_dotcom %} Pages?](/articles/what-is-github-pages)"
You can also use a branch to publish a {% data variables.product.prodname_pages %} site. For more information, see "[About {% data variables.product.prodname_pages %}](/articles/what-is-github-pages)."
You must have write access to a repository to create a branch, open a pull request, or delete and restore branches in a pull request. For more information, see "[Access permissions on {% data variables.product.product_name %}](/articles/access-permissions-on-github)."
You must have write access to a repository to create a branch, open a pull request, or delete and restore branches in a pull request. For more information, see "[Access permissions on {% data variables.product.prodname_dotcom %}](/github/getting-started-with-github/access-permissions-on-github)."
### About the default branch
{% data reusables.branches.new-repo-default-branch %} The default branch is the branch that {% data variables.product.prodname_dotcom %} displays when anyone visits your repository. The default branch is also the initial branch that Git checks out locally out when someone clones the repository. {% data reusables.branches.default-branch-automatically-base-branch %}
By default, {% data variables.product.product_name %} names the default branch {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.23" %}`main`{% else %}`master`{% endif %} in any new repository.
{% data reusables.branches.change-default-branch %}
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.22" %}
By default, the default branch name is `master`, but you can set the name to anything that makes sense for your workflow. For more information on the default branch name, see "[Managing the default branch name for your repositories](/github/setting-up-and-managing-your-github-user-account/managing-the-default-branch-name-for-your-repositories)."
{% data reusables.branches.set-default-branch %}
{% endif %}
{% data reusables.branches.set-default-branch %}
### Working with branches
Once you're satisfied with your work, you can open a pull request to merge the changes in the current branch (the *head* branch) into another branch (the *base* branch). For more information, see "[About pull requests](/articles/about-pull-requests)."

View File

@@ -18,7 +18,7 @@ You can specify which branch you'd like to merge your changes into when you crea
### Changing the branch range and destination repository
By default, pull requests are based on the parent repository's [default branch](/articles/setting-the-default-branch).
By default, pull requests are based on the parent repository's default branch. For more information, see "[About branches](/github/collaborating-with-issues-and-pull-requests/about-branches#about-the-default-branch)."
If the default parent repository isn't correct, you can change both the parent repository and the branch with the drop-down lists. You can also swap your head and base branches with the drop-down lists to establish diffs between reference points. References here must be branch names in your GitHub repository.

View File

@@ -24,7 +24,7 @@ versions:
{% data reusables.pull_requests.automatically-delete-branches %}
If the branch you want to delete is the repository's default branch, you must choose a new default branch before deleting the branch. For more information, see "[Setting the default branch](/github/administering-a-repository/setting-the-default-branch)."
If the branch you want to delete is the repository's default branch, you must choose a new default branch before deleting the branch. For more information, see "[Changing the default branch](/github/administering-a-repository/changing-the-default-branch)."
If the branch you want to delete is associated with an open pull request, you must merge or close the pull request before deleting the branch. For more information, see "[Merging a pull request](/github/collaborating-with-issues-and-pull-requests/merging-a-pull-request)" or "[Closing a pull request](/github/collaborating-with-issues-and-pull-requests/closing-a-pull-request)."

View File

@@ -11,7 +11,7 @@ versions:
2. Change the current working directory to your local project.
3. Check out the branch you wish to merge to. Usually, you will merge into the default branch.
```shell
$ git checkout <em>master</em>
$ git checkout <em>DEFAULT_BRANCH_NAME</em>
```
4. Pull the desired branch from the upstream repository. This method will retain the commit history without modification.
```shell
@@ -22,5 +22,5 @@ versions:
7. Review the changes and ensure they are satisfactory.
8. Push the merge to your GitHub repository.
```shell
$ git push origin <em>master</em>
$ git push origin <em>DEFAULT_BRANCH_NAME</em>
```

View File

@@ -83,8 +83,8 @@ For example, if you edited a file, such as *README.md*, and another person remov
2. Generate a list of the files affected by the merge conflict. In this example, the file *README.md* has a merge conflict.
```shell
$ git status
> # On branch master
> # Your branch and 'origin/master' have diverged,
> # On branch main
> # Your branch and 'origin/main' have diverged,
> # and have 1 and 2 different commits each, respectively.
> # (use "git pull" to merge the remote branch into yours)
> # You have unmerged paths.

View File

@@ -21,7 +21,7 @@ Total 3 (delta 0), reused 0 (delta 0)
remote: always_reject.sh: failed with exit status 1
remote: error: rejecting all pushes
To https://54.204.174.51/hodor/nope.git
! [remote rejected] master -> master (pre-receive hook declined)
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://54.204.174.51/hodor/nope.git'
```