Skip to content
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

Support Fork with Default Branch Only #6983

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

jsoref
Copy link
Contributor

@jsoref jsoref commented Feb 7, 2023

Fixes #6984

https://docs.github.com/en/rest/repos/forks?apiVersion=2022-11-28#create-a-fork includes a default_branch_only flag.
Introduced: https://github.blog/changelog/2022-07-27-you-can-now-fork-a-repo-and-copy-only-the-default-branch/

The web interface for this looks like this:
image

Note that the default behavior (at least for me?) in the web interface is to use this flag. That'd be way too much of an api change for me to introduce here, so we're going with the default legacy behavior of default_branch_only=false (well, technically unset, which lets GitHub change the fork behavior server-side in the future).

@jsoref jsoref requested a review from a team as a code owner February 7, 2023 14:51
@jsoref jsoref requested review from samcoe and removed request for a team February 7, 2023 14:51
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Feb 7, 2023
@cliAutomation
Copy link
Collaborator

Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message.

@cliAutomation cliAutomation added this to Needs review 🤔 in The GitHub CLI Feb 7, 2023
@jsoref jsoref mentioned this pull request Feb 7, 2023
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Only a small but important detail about boolean type

api/queries_repo.go Outdated Show resolved Hide resolved
@jsoref jsoref force-pushed the repo-fork-default-branch-only branch from f833800 to e6d6427 Compare February 7, 2023 15:00
@jsoref jsoref requested review from mislav and removed request for samcoe February 7, 2023 15:01
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

The GitHub CLI automation moved this from Needs review 🤔 to Needs to be merged 🎉 Feb 7, 2023
@mislav mislav merged commit 3c0c450 into cli:trunk Feb 7, 2023
The GitHub CLI automation moved this from Needs to be merged 🎉 to Pending Release 🥚 Feb 7, 2023
@jsoref jsoref deleted the repo-fork-default-branch-only branch February 7, 2023 16:31
@github-actions github-actions bot moved this from Pending Release 🥚 to Done 💤 in The GitHub CLI Feb 8, 2023
Copy link

@thereeroyz thereeroyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external pull request originating outside of the CLI core team
Projects
No open projects
The GitHub CLI
  
Done 💤
Development

Successfully merging this pull request may close these issues.

Add support for creating forks with default_branch_only
4 participants