Skip to content

vmware-automation branch --remote flag is unsupported when a repository argument is provided in setup_vm_part2.yml` #110

Description

@gitgithan

In automation/vm-ansible-setup/playbooks/setup_vm_part2.yml

It has ansible.builtin.command: gh repo fork lewagon/data-engineering-challenges --remote

This causes during playbook run.

fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["gh", "repo", "fork", "lewagon/data-engineering-challenges", "--remote"], "delta": "0:00:00.089997", "end": "2026-09-08 05:36:12.685628", "msg": "non-zero return code", "rc": 1, "start": "2026-09-08 05:36:12.595631", "stderr": "the--remoteflag is unsupported when a repository argument is provided\n\nUsage: gh repo fork [<repository>] [-- <gitflags>...] [flags]\n\nFlags:\n --clone Clone the fork\n --default-branch-only Only include the default branch in the fork\n --fork-name string Rename the forked repository\n --org string Create the fork in an organization\n --remote Add a git remote for the fork\n --remote-name string Specify the name for the new remote (default \"origin\")\n ", "stderr_lines": ["the--remoteflag is unsupported when a repository argument is provided", "", "Usage: gh repo fork [<repository>] [-- <gitflags>...] [flags]", "", "Flags:", " --clone Clone the fork", " --default-branch-only Only include the default branch in the fork", " --fork-name string Rename the forked repository", " --org string Create the fork in an organization", " --remote Add a git remote for the fork", " --remote-name string Specify the name for the new remote (default \"origin\")", " "], "stdout": "", "stdout_lines": []}

Why the Flag Failed
gh repo fork owner/repo is meant for creating a new fork on GitHub (and optionally cloning it via --clone).
gh repo fork --remote is meant for running inside an existing local git directory to create a fork on GitHub and attach it as a remote to your local folder.

Fix
change --remote to --clone
gh repo fork lewagon/data-engineering-challenges --clone

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions