Repository navigation
Fetch the created branch on gh issue develop #7588
Description
Activity
@Shion1305 Thanks for writing in, the
gh issue developcommand already supports the--checkoutflag which provides the functionality that you are requesting. Is there some functionality that you are looking for that the flag does not provide?Reacted by Shion Ichikawa- addedmore-info-neededMore info needed from user/contributorMore info needed from user/contributorand removedneeds-triageneeds to be reviewedneeds to be reviewed
on Jun 19, 2023 Hi @samcoe , thanks for your response.
I agree with you that the --checkout flag allows the branch to be fetched and checkouted on the local machine.
When we use the gh issue develop command without specifying the --checkout flag, the branch is created on the remote but isn't fetched on the local machine. I think this is unuseful for some users as they might expect the branch to be available locally as well.@Shion1305 I think I understand better now. If the user wants to get started developing locally on the branch, and they have not specified the
--checkoutflag, then they must rungit checkout -b <branch-name>correct? That command should implicitly fetch the branch, so I am not sure what value would be provided by doing the fetch inside of theissue developcommand.@samcoe I did't know that
git checkout -b <branch-name>will automatically run fetch. I usually useswitchcommand when creating local branch from remote branch. I encountered the situation that I usegh issue developwithout using--checkoutflag and after that failed to create local branch withgit switchcommand. And I thought it would be better to automatically fetch the created branch ongh issue developcommand.Well, I think
git checkout -b <branch-name>creates a new branch without link to remote branch, so users who usesgh issue developmay want to usegit checkoutrather thangit checkout -bReacted by Sam Coe@Shion1305 You are correct,
git checkoutwithout the-bflag.Reacted by Shion Ichikawa@Shion1305 I just tried using
git switchand it does not work, so that is kind of a shame that it does not have the same behavior asgit checkout. Having said that I think usinggit switchis probably pretty common workflow so we should support it. I am open to adding thegit fetchautomatically to theissue developcommand.Reacted by Shion Ichikawa- addedhelp wantedContributions welcomeContributions welcomeand removedmore-info-neededMore info needed from user/contributorMore info needed from user/contributor
on Jun 19, 2023
Describe the feature or problem you’d like to solve
When creating a remote branch using
gh issue develop, it seems that the created branch won't be automatically fetched in the local machine.Proposed solution
Automatically fetch the created branch on
gh issue developafter the remote branch is created on GitHub