Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Prepend username to branch name when fetching from other's repo #583

Open
dantewang opened this issue Nov 8, 2018 · 2 comments
Open

Prepend username to branch name when fetching from other's repo #583

dantewang opened this issue Nov 8, 2018 · 2 comments

Comments

@dantewang
Copy link

For example, can we make gh pr 100 fetches the PR on my repo to local branch pr-100, while gh pr 100 -u johndoe fetches the PR on John Doe's repo to local branch john-doe-pr-100?

@protoEvangelion
Copy link
Member

@dantewang That is a good use case thanks for bringing it up.

In ~/.gh.json there is a field that we could leverage to do this: "pull_branch_name_prefix": "pr-",.

One approach might be to add something like "pull_branch_name_prefix": "{{options.user}}-pr-", and where we set the branch name dynamically add the user name at that point.

If you are interested the relevant code to make this change would be here:
https://github.com/node-gh/gh/blob/master/lib/cmds/pull-request.js#L417

@Altofersquare
Copy link

@dantewang That is a good use case thanks for bringing it up.

In ~/.gh.json there is a field that we could leverage to do this: "pull_branch_name_prefix": "pr-",.

One approach might be to add something like "pull_branch_name_prefix": "{{options.user}}-pr-", and where we set the branch name dynamically add the user name at that point.

If you are interested the relevant code to make this change would be here:
https://github.com/node-gh/gh/blob/master/lib/cmds/pull-request.js#L417

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants