Skip to content

Commit 1f86d4b

Browse files
authored
Merge pull request #12170 from github/repo-sync
repo sync
2 parents 35b0d0c + 83db126 commit 1f86d4b

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

content/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ To replace all text listed in `passwords.txt` wherever it can be found in your r
5050
$ bfg --replace-text passwords.txt
5151
```
5252

53-
After the sensitive data is removed, you must force push your changes to {% data variables.product.product_name %}.
53+
After the sensitive data is removed, you must force push your changes to {% data variables.product.product_name %}. Force pushing rewrites the repository history, which removes sensitive data from the commit history. If you force push, it may overwrite commits that other people have based their work on.
5454

5555
```shell
5656
$ git push --force
@@ -124,7 +124,7 @@ To illustrate how `git filter-repo` works, we'll show you how to remove your fil
124124
> 1 files changed, 1 insertions(+), 0 deletions(-)
125125
```
126126
6. Double-check that you've removed everything you wanted to from your repository's history, and that all of your branches are checked out.
127-
7. Once you're happy with the state of your repository, force-push your local changes to overwrite your repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %}, as well as all the branches you've pushed up:
127+
7. Once you're happy with the state of your repository, force-push your local changes to overwrite your repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.product.product_location %}{% endif %}, as well as all the branches you've pushed up. A force push is required to remove sensitive data from your commit history.
128128
```shell
129129
$ git push origin --force --all
130130
> Counting objects: 1074, done.

content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ topics:
2121

2222
**Note:** When working with pull requests, keep the following in mind:
2323
* If you're working in the [shared repository model](/pull-requests/collaborating-with-pull-requests/getting-started/about-collaborative-development-models), we recommend that you use a topic branch for your pull request. While you can send pull requests from any branch or commit, with a topic branch you can push follow-up commits if you need to update your proposed changes.
24-
* When pushing commits to a pull request, don't force push. Force pushing can corrupt your pull request.
24+
* When pushing commits to a pull request, don't force push. Force pushing changes the repository history and can corrupt your pull request. If other collaborators branch the project before a force push, the force push may overwrite commits that collaborators based their work on.
2525

2626
{% endnote %}
2727

content/pull-requests/committing-changes-to-your-project/troubleshooting-commits/commit-exists-on-github-but-not-in-my-local-clone.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ $ git fetch upstream recover-B
8484

8585
## Avoid force pushes
8686

87-
Avoid force pushing to a repository unless absolutely necessary. This is especially true if more than one person can push to the repository.
87+
Avoid force pushing to a repository unless absolutely necessary. This is especially true if more than one person can push to the repository. If someone force pushes to a repository, the force push may overwrite commits that other people based their work on. Force pushing changes the repository history and can corrupt pull requests.
8888

8989
## Further reading
9090

content/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ You can only give push access to a protected branch to users, teams, or installe
157157

158158
### Allow force pushes
159159

160-
By default, {% data variables.product.product_name %} blocks force pushes on all protected branches. When you enable force pushes to a protected branch, anyone with at least write permissions to the repository can force push to the branch, including those with admin permissions.
160+
By default, {% data variables.product.product_name %} blocks force pushes on all protected branches. When you enable force pushes to a protected branch, anyone with at least write permissions to the repository can force push to the branch, including those with admin permissions. If someone force pushes to a branch, the force push may overwrite commits that other collaborators based their work on. People may have merge conflicts or corrupted pull requests.
161161

162162
Enabling force pushes will not override any other branch protection rules. For example, if a branch requires a linear commit history, you cannot force push merge commits to that branch.
163163

content/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ When you create a branch rule, the branch you specify doesn't have to exist yet
104104
![Branch restriction checkbox](/assets/images/help/repository/restrict-branch.png)
105105
- Search for and select the people, teams, or apps who will have permission to push to the protected branch.
106106
![Branch restriction search](/assets/images/help/repository/restrict-branch-search.png)
107-
1. Optionally, under "Rules applied to everyone including administrators", select **Allow force pushes**.
107+
2. Optionally, under "Rules applied to everyone including administrators", select **Allow force pushes**. For more information about force pushes, see "[Allow force pushes](/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches/#allow-force-pushes)."
108108
![Allow force pushes option](/assets/images/help/repository/allow-force-pushes.png)
109109
1. Optionally, select **Allow deletions**.
110110
![Allow branch deletions option](/assets/images/help/repository/allow-branch-deletions.png)

0 commit comments

Comments
 (0)