Skip to content

repo sync #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You can choose the default branch for a repository. The default branch is the ba

{% note %}

**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.
**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.

{% endnote %}

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

{% endif %}
29 changes: 29 additions & 0 deletions script/anonymize-branch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env node

// [start-readme]
//
// Flatten all the commits in the current branch into a single anonymized @Octomerger commit
//
// Usage: script/anonymize-branch.js <new-commit-message> [base-branch]
// Example: script/anonymize-branch.js "nothing to see here"
// If the optional [base-branch] argument is omitted, it will default to `main`
//
// [end-readme]

process.env.GIT_AUTHOR_NAME = process.env.GIT_COMMITTER_NAME = 'Octomerger Bot'
process.env.GIT_AUTHOR_EMAIL = process.env.GIT_COMMITTER_EMAIL = '[email protected]'

const { execSync: exec } = require('child_process')
const path = require('path')
const args = process.argv.slice(2)
const message = args[0]
const base = args[1] || 'main'

if (!message || !message.length) {
console.error(`Specify a new commit message in quotes. Example:\n\nscript/${path.basename(module.filename)} "new commit"`)
process.exit()
}

exec(`git reset $(git merge-base ${base} HEAD)`)
exec('git add -A')
exec(`git commit -m "${message}"`)