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

Feature Request: Fork Only Default Branch #1993

Open
gounthar opened this issue Dec 3, 2024 · 8 comments · May be fixed by #1995
Open

Feature Request: Fork Only Default Branch #1993

gounthar opened this issue Dec 3, 2024 · 8 comments · May be fixed by #1995

Comments

@gounthar
Copy link

gounthar commented Dec 3, 2024

What feature do you want to see added?

Current Situation

When forking a repository on GitHub, our current process retrieves all branches from the original repository.

Issue

This approach may be inefficient and unnecessary for our use case.

Desired Outcome

We aim to fork only the default branch of the repository, as this is typically sufficient for our work.

GitHub GUI Option

The GitHub web interface provides an option to fork only the default branch (usually the main branch).

Benefits

  1. Efficiency: Reduces unnecessary data transfer and storage.
  2. Simplicity: Maintains a cleaner repository structure in our forks.
  3. Focus: Aligns with our primary need of working with the main branch.

Conclusion

Optimizing our forking process to retrieve only the main branch will streamline our workflow and improve overall efficiency. This change aligns with best practices for managing forks when only the main branch is needed for development or analysis purposes.

@bitwiseman
Copy link
Member

Please look at the GitHub API documentation and see if this option is provided there.

@gounthar
Copy link
Author

gounthar commented Dec 4, 2024

Thanks, I'll do that and keep this issue updated. 👍

@gounthar
Copy link
Author

gounthar commented Dec 4, 2024

I tried with this bash script:

#!/bin/bash
set -eux

GITHUB_TOKEN="my_token"
OWNER="jenkinsci"
REPO="pipeline-graph-view-plugin"
NEW_OWNER="gounthar"

# API endpoint for forking a repository
API_URL="https://api.github.com/repos/$OWNER/$REPO/forks"

# Make the API request to fork the repository
curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  -H "Content-Type: application/json" \
  $API_URL \
  -d '{"default_branch_only":true}'

and it worked. My fork only has one branch:

{
  "id": 898464498,
  "node_id": "R_kgDONY168g",
  "name": "pipeline-graph-view-plugin",
  "full_name": "gounthar/pipeline-graph-view-plugin",
  "private": false,
  "owner": {
    "login": "gounthar",
    "id": 116569,
    "node_id": "MDQ6VXNlcjExNjU2OQ==",
    "avatar_url": "https://avatars.githubusercontent.com/u/116569?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/gounthar",
    "html_url": "https://github.com/gounthar",
    "followers_url": "https://api.github.com/users/gounthar/followers",
    "following_url": "https://api.github.com/users/gounthar/following{/other_user}",
    "gists_url": "https://api.github.com/users/gounthar/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/gounthar/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/gounthar/subscriptions",
    "organizations_url": "https://api.github.com/users/gounthar/orgs",
    "repos_url": "https://api.github.com/users/gounthar/repos",
    "events_url": "https://api.github.com/users/gounthar/events{/privacy}",
    "received_events_url": "https://api.github.com/users/gounthar/received_events",
    "type": "User",
    "user_view_type": "public",
    "site_admin": false
  },
  "html_url": "https://github.com/gounthar/pipeline-graph-view-plugin",
  "description": null,
  "fork": true,
  "url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin",
  "forks_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/forks",
  "keys_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/keys{/key_id}",
  "collaborators_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/collaborators{/collaborator}",
  "teams_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/teams",
  "hooks_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/hooks",
  "issue_events_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/issues/events{/number}",
  "events_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/events",
  "assignees_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/assignees{/user}",
  "branches_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/branches{/branch}",
  "tags_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/tags",
  "blobs_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/git/blobs{/sha}",
  "git_tags_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/git/tags{/sha}",
  "git_refs_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/git/refs{/sha}",
  "trees_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/git/trees{/sha}",
  "statuses_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/statuses/{sha}",
  "languages_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/languages",
  "stargazers_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/stargazers",
  "contributors_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/contributors",
  "subscribers_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/subscribers",
  "subscription_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/subscription",
  "commits_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/commits{/sha}",
  "git_commits_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/git/commits{/sha}",
  "comments_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/comments{/number}",
  "issue_comment_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/issues/comments{/number}",
  "contents_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/contents/{+path}",
  "compare_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/compare/{base}...{head}",
  "merges_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/merges",
  "archive_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/{archive_format}{/ref}",
  "downloads_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/downloads",
  "issues_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/issues{/number}",
  "pulls_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/pulls{/number}",
  "milestones_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/milestones{/number}",
  "notifications_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/notifications{?since,all,participating}",
  "labels_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/labels{/name}",
  "releases_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/releases{/id}",
  "deployments_url": "https://api.github.com/repos/gounthar/pipeline-graph-view-plugin/deployments",
  "created_at": "2024-12-04T12:50:23Z",
  "updated_at": "2024-12-04T12:50:23Z",
  "pushed_at": "2024-12-04T11:31:40Z",
  "git_url": "git://github.com/gounthar/pipeline-graph-view-plugin.git",
  "ssh_url": "[email protected]:gounthar/pipeline-graph-view-plugin.git",
  "clone_url": "https://github.com/gounthar/pipeline-graph-view-plugin.git",
  "svn_url": "https://github.com/gounthar/pipeline-graph-view-plugin",
  "homepage": "https://plugins.jenkins.io/pipeline-graph-view/",
  "size": 2524,
  "stargazers_count": 0,
  "watchers_count": 0,
  "language": null,
  "has_issues": false,
  "has_projects": true,
  "has_downloads": true,
  "has_wiki": false,
  "has_pages": false,
  "has_discussions": false,
  "forks_count": 0,
  "mirror_url": null,
  "archived": false,
  "disabled": false,
  "open_issues_count": 0,
  "license": null,
  "allow_forking": true,
  "is_template": false,
  "web_commit_signoff_required": false,
  "topics": [

  ],
  "visibility": "public",
  "forks": 0,
  "open_issues": 0,
  "watchers": 0,
  "default_branch": "main",
  "permissions": {
    "admin": true,
    "maintain": true,
    "push": true,
    "triage": true,
    "pull": true
  },
  "parent": {
    "id": 342357420,
    "node_id": "MDEwOlJlcG9zaXRvcnkzNDIzNTc0MjA=",
    "name": "pipeline-graph-view-plugin",
    "full_name": "jenkinsci/pipeline-graph-view-plugin",
    "private": false,
    "owner": {
      "login": "jenkinsci",
      "id": 107424,
      "node_id": "MDEyOk9yZ2FuaXphdGlvbjEwNzQyNA==",
      "avatar_url": "https://avatars.githubusercontent.com/u/107424?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/jenkinsci",
      "html_url": "https://github.com/jenkinsci",
      "followers_url": "https://api.github.com/users/jenkinsci/followers",
      "following_url": "https://api.github.com/users/jenkinsci/following{/other_user}",
      "gists_url": "https://api.github.com/users/jenkinsci/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/jenkinsci/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/jenkinsci/subscriptions",
      "organizations_url": "https://api.github.com/users/jenkinsci/orgs",
      "repos_url": "https://api.github.com/users/jenkinsci/repos",
      "events_url": "https://api.github.com/users/jenkinsci/events{/privacy}",
      "received_events_url": "https://api.github.com/users/jenkinsci/received_events",
      "type": "Organization",
      "user_view_type": "public",
      "site_admin": false
    },
    "html_url": "https://github.com/jenkinsci/pipeline-graph-view-plugin",
    "description": null,
    "fork": false,
    "url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin",
    "forks_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/forks",
    "keys_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/teams",
    "hooks_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/hooks",
    "issue_events_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/issues/events{/number}",
    "events_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/events",
    "assignees_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/assignees{/user}",
    "branches_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/branches{/branch}",
    "tags_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/tags",
    "blobs_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/languages",
    "stargazers_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/stargazers",
    "contributors_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/contributors",
    "subscribers_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/subscribers",
    "subscription_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/subscription",
    "commits_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/contents/{+path}",
    "compare_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/merges",
    "archive_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/downloads",
    "issues_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/issues{/number}",
    "pulls_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/labels{/name}",
    "releases_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/releases{/id}",
    "deployments_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/deployments",
    "created_at": "2021-02-25T19:32:57Z",
    "updated_at": "2024-11-18T20:31:04Z",
    "pushed_at": "2024-12-04T11:31:40Z",
    "git_url": "git://github.com/jenkinsci/pipeline-graph-view-plugin.git",
    "ssh_url": "[email protected]:jenkinsci/pipeline-graph-view-plugin.git",
    "clone_url": "https://github.com/jenkinsci/pipeline-graph-view-plugin.git",
    "svn_url": "https://github.com/jenkinsci/pipeline-graph-view-plugin",
    "homepage": "https://plugins.jenkins.io/pipeline-graph-view/",
    "size": 2524,
    "stargazers_count": 110,
    "watchers_count": 110,
    "language": "Java",
    "has_issues": true,
    "has_projects": true,
    "has_downloads": true,
    "has_wiki": false,
    "has_pages": false,
    "has_discussions": false,
    "forks_count": 56,
    "mirror_url": null,
    "archived": false,
    "disabled": false,
    "open_issues_count": 77,
    "license": {
      "key": "other",
      "name": "Other",
      "spdx_id": "NOASSERTION",
      "url": null,
      "node_id": "MDc6TGljZW5zZTA="
    },
    "allow_forking": true,
    "is_template": false,
    "web_commit_signoff_required": false,
    "topics": [

    ],
    "visibility": "public",
    "forks": 56,
    "open_issues": 77,
    "watchers": 110,
    "default_branch": "main"
  },
  "source": {
    "id": 342357420,
    "node_id": "MDEwOlJlcG9zaXRvcnkzNDIzNTc0MjA=",
    "name": "pipeline-graph-view-plugin",
    "full_name": "jenkinsci/pipeline-graph-view-plugin",
    "private": false,
    "owner": {
      "login": "jenkinsci",
      "id": 107424,
      "node_id": "MDEyOk9yZ2FuaXphdGlvbjEwNzQyNA==",
      "avatar_url": "https://avatars.githubusercontent.com/u/107424?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/jenkinsci",
      "html_url": "https://github.com/jenkinsci",
      "followers_url": "https://api.github.com/users/jenkinsci/followers",
      "following_url": "https://api.github.com/users/jenkinsci/following{/other_user}",
      "gists_url": "https://api.github.com/users/jenkinsci/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/jenkinsci/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/jenkinsci/subscriptions",
      "organizations_url": "https://api.github.com/users/jenkinsci/orgs",
      "repos_url": "https://api.github.com/users/jenkinsci/repos",
      "events_url": "https://api.github.com/users/jenkinsci/events{/privacy}",
      "received_events_url": "https://api.github.com/users/jenkinsci/received_events",
      "type": "Organization",
      "user_view_type": "public",
      "site_admin": false
    },
    "html_url": "https://github.com/jenkinsci/pipeline-graph-view-plugin",
    "description": null,
    "fork": false,
    "url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin",
    "forks_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/forks",
    "keys_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/teams",
    "hooks_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/hooks",
    "issue_events_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/issues/events{/number}",
    "events_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/events",
    "assignees_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/assignees{/user}",
    "branches_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/branches{/branch}",
    "tags_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/tags",
    "blobs_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/languages",
    "stargazers_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/stargazers",
    "contributors_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/contributors",
    "subscribers_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/subscribers",
    "subscription_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/subscription",
    "commits_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/contents/{+path}",
    "compare_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/merges",
    "archive_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/downloads",
    "issues_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/issues{/number}",
    "pulls_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/labels{/name}",
    "releases_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/releases{/id}",
    "deployments_url": "https://api.github.com/repos/jenkinsci/pipeline-graph-view-plugin/deployments",
    "created_at": "2021-02-25T19:32:57Z",
    "updated_at": "2024-11-18T20:31:04Z",
    "pushed_at": "2024-12-04T11:31:40Z",
    "git_url": "git://github.com/jenkinsci/pipeline-graph-view-plugin.git",
    "ssh_url": "[email protected]:jenkinsci/pipeline-graph-view-plugin.git",
    "clone_url": "https://github.com/jenkinsci/pipeline-graph-view-plugin.git",
    "svn_url": "https://github.com/jenkinsci/pipeline-graph-view-plugin",
    "homepage": "https://plugins.jenkins.io/pipeline-graph-view/",
    "size": 2524,
    "stargazers_count": 110,
    "watchers_count": 110,
    "language": "Java",
    "has_issues": true,
    "has_projects": true,
    "has_downloads": true,
    "has_wiki": false,
    "has_pages": false,
    "has_discussions": false,
    "forks_count": 55,
    "mirror_url": null,
    "archived": false,
    "disabled": false,
    "open_issues_count": 77,
    "license": {
      "key": "other",
      "name": "Other",
      "spdx_id": "NOASSERTION",
      "url": null,
      "node_id": "MDc6TGljZW5zZTA="
    },
    "allow_forking": true,
    "is_template": false,
    "web_commit_signoff_required": false,
    "topics": [

    ],
    "visibility": "public",
    "forks": 55,
    "open_issues": 77,
    "watchers": 110,
    "default_branch": "main"
  },
  "network_count": 55,
  "subscribers_count": 0
}

@bitwiseman
Copy link
Member

bitwiseman commented Dec 5, 2024

"default_branch_only":true - excellent there is an parameter in the API. This is good first issue for someone wanting to contribute.

REST API doc:
https://docs.github.com/en/enterprise-cloud@latest/rest/repos/forks?apiVersion=2022-11-28#create-a-fork

@gounthar
Copy link
Author

gounthar commented Dec 5, 2024

Yes.
I've made an attempt, but currently, I'm struggling to find the right approach for implementing that into the code. 🤷

@bitwiseman
Copy link
Member

@gounthar Awesome, post your attempt as a PR (even if incomplete and we can discuss.

From the API doc, there are three optional parameters:

  • organization
  • name
  • default_branch_only

We have to different method to create forks GHRepository.fork() and GHRepository.forkTo(GHOrganization).

I kind of understand why someone chose the two names but... We should probably mark both of these as @Deprecated, have them both call into a new method named createFork() which is a helper for a createFork(String organization, String name, boolean default_branch_only). null, "", or false are ignored, otherwise the parameter is sent. Does this make sense?

@gounthar
Copy link
Author

gounthar commented Dec 9, 2024

Yes, thanks for the explanation, @bitwiseman. 👍

@gounthar
Copy link
Author

Here is an incomplete and draft PR: #1994.
Thanks. 👍

@Alaurant Alaurant linked a pull request Dec 13, 2024 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants