gitstatus icon indicating copy to clipboard operation
gitstatus copied to clipboard

Respect git config values for remote and pushRemote

Open Machine-Maker opened this issue 3 years ago • 3 comments

When using the gh cli to checkout a PR from some repository, instead of adding the remote and then checking out the branch, it adds config entries for that specific branch telling git where pushes should go. Issue here is, that gitstatus (via powerlevel10k) isn't showing commits ahead or behind that remote/branch, probably because it doesn't know it has one cause its not checking the local git config.

Machine-Maker avatar Jan 10 '22 03:01 Machine-Maker

What do I need to do to reproduce this?

romkatv avatar Jan 10 '22 07:01 romkatv

Have a GitHub repo that has an open PR from a fork, not a different branch in the same repo. Then use the GitHub cli tool to checkout that pr, so gh pr checkout ####. You can then add a commit. gitstatus should say you are 1 ahead, but it doesn’t. And a git push succeeds in pushing to the branch the PR is from.

after checking out the branch with the gh CLI tool, you can also look at the local git config git config —edit to see how it configures the remote for that specific branch.

Machine-Maker avatar Jan 10 '22 10:01 Machine-Maker

I might take a look at it but not soon. Maybe in a month or two.

If you can provide more specific instructions (commands I can run, which don't require gh and don't use Internet), it'll speed things up considerably.

romkatv avatar Jan 10 '22 10:01 romkatv

Closing because I don't intend to do anything here.

romkatv avatar Sep 21 '22 09:09 romkatv