Prepend username to branch name when fetching from other's repo
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?
@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
@dantewang That is a good use case thanks for bringing it up.
In
~/.gh.jsonthere 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