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

Add --pr flag to repo clone command and/or a pr clone command #825

Open
jskrzypek opened this issue Apr 23, 2020 · 0 comments
Open

Add --pr flag to repo clone command and/or a pr clone command #825

jskrzypek opened this issue Apr 23, 2020 · 0 comments
Labels
core This issue is not accepting PRs from outside contributors enhancement a request to improve CLI gh-repo relating to the gh repo command

Comments

@jskrzypek
Copy link

Describe the feature or problem you’d like to solve

Essentially I would like to use the tool to pull down the code at the head of a specific PR in CI & other automated scripts w/ containerized machines a la kubernetes pods, etc., using only the PR's number.

This is currently possible by doing

gh repo clone myorg/myrepo
cd myrepo
gh pr checkout 123

however that can take a long time if the repository has an extensive history or a lot of files.

For these situations I don't need to clone my whole repo and would like to simply clone with --single-branch and --depth 1 and a PR's branch name to make it faster.

Proposed solution

Given the existing infrastructure in the CLI for parsing PR info, this should be straightfoward, and as simple as translating a --pr flag into git-clone's already-supported --branch flag.

@jskrzypek jskrzypek added the enhancement a request to improve CLI label Apr 23, 2020
@jskrzypek jskrzypek changed the title Add pr flags to the repo clone command and/or a pr clone command Add --pr flags to repo clone command and/or a pr clone command Apr 23, 2020
@jskrzypek jskrzypek changed the title Add --pr flags to repo clone command and/or a pr clone command Add --pr flag to repo clone command and/or a pr clone command Apr 23, 2020
@vilmibm vilmibm added the core This issue is not accepting PRs from outside contributors label Oct 7, 2020
@samcoe samcoe added the gh-repo relating to the gh repo command label Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core This issue is not accepting PRs from outside contributors enhancement a request to improve CLI gh-repo relating to the gh repo command
Projects
None yet
Development

No branches or pull requests

3 participants