Skip to content

Commit 16c954d

Browse files
authored
Merge pull request #175 from github/repo-sync
repo sync
2 parents f4599bf + 97b949a commit 16c954d

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

content/github/administering-a-repository/changing-the-default-branch.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ You can choose the default branch for a repository. The default branch is the ba
1616

1717
{% note %}
1818

19-
**Note**: If you use the Git-Subversion bridge, setting a different default branch will affect your `trunk` branch contents and the `HEAD` you see when you list references for the remote repository. For more information, see "[Support for Subversion clients](/github/importing-your-projects-to-github/support-for-subversion-clients)" and [git-ls-remote](https://git-scm.com/docs/git-ls-remote.html) in the Git documentation.
19+
**Note**: If you use the Git-Subversion bridge, changing the default branch will affect your `trunk` branch contents and the `HEAD` you see when you list references for the remote repository. For more information, see "[Support for Subversion clients](/github/importing-your-projects-to-github/support-for-subversion-clients)" and [git-ls-remote](https://git-scm.com/docs/git-ls-remote.html) in the Git documentation.
2020

2121
{% endnote %}
2222

@@ -51,8 +51,8 @@ To change the default branch, your repository must have more than one branch. Fo
5151
{% data reusables.repositories.navigate-to-repo %}
5252
{% data reusables.repositories.sidebar-settings %}
5353
{% data reusables.repositories.repository-branches %}
54-
4. In the default branch drop-down, choose the new default branch.
54+
1. In the default branch drop-down, choose the new default branch.
5555
![Default branch dropdown selector](/assets/images/help/repository/repository-options-defaultbranch.png)
56-
5. Click **Update**.
56+
1. Click **Update**.
5757

5858
{% endif %}

script/anonymize-branch.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env node
2+
3+
// [start-readme]
4+
//
5+
// Flatten all the commits in the current branch into a single anonymized @Octomerger commit
6+
//
7+
// Usage: script/anonymize-branch.js <new-commit-message> [base-branch]
8+
// Example: script/anonymize-branch.js "nothing to see here"
9+
// If the optional [base-branch] argument is omitted, it will default to `main`
10+
//
11+
// [end-readme]
12+
13+
process.env.GIT_AUTHOR_NAME = process.env.GIT_COMMITTER_NAME = 'Octomerger Bot'
14+
process.env.GIT_AUTHOR_EMAIL = process.env.GIT_COMMITTER_EMAIL = '[email protected]'
15+
16+
const { execSync: exec } = require('child_process')
17+
const path = require('path')
18+
const args = process.argv.slice(2)
19+
const message = args[0]
20+
const base = args[1] || 'main'
21+
22+
if (!message || !message.length) {
23+
console.error(`Specify a new commit message in quotes. Example:\n\nscript/${path.basename(module.filename)} "new commit"`)
24+
process.exit()
25+
}
26+
27+
exec(`git reset $(git merge-base ${base} HEAD)`)
28+
exec('git add -A')
29+
exec(`git commit -m "${message}"`)

0 commit comments

Comments
 (0)