3 ms·
It's not a replacement for git, its to interact with the GitHub UI over the command line. There are 3 main commands from the CLI you can issue: gh CORE C
by cfors 6y ago
It's not a replacement for git, its to interact with the GitHub UI over the command line.
There are 3 main commands from the CLI you can issue:
gh
CORE COMMANDS
issue: Create and view issues
pr: Create, view, and checkout pull requests
repo: Create, clone, fork, and view repositories
I still use the git cli and the github UI, but sometimes just view open PR's from the my terminal if I'm already in there.
- Galanwe 6y agoHonestly the doc make it pretty unclear. Some commands seem to be purely github related, which make sense, some others seem to overlap with just plain git. > Clone the repository you want to work with using gh repo clone owner/repo Like, what does this do apart from a regular git clone? Why is this necessary? I guess it additionally stores some meta information so that other "gh" commands know which repo they are on. This should have been a separate command IMHO to leave the regular git clone alone. Something like "git clone ssh://github.com/foo/bar" followed by "gh init foo/bar". > When you’ve finished adding that feature or fixing that bug, use gh pr create Same goes here. Why overlaying git commands? I would have expected to just push my branch, and then call something like "gh pr create <my branch> <target branch>" > And your teammate can check out your pull request using gh pr checkout 1337 Same remark again and again, what does that do apart from checking out a branch? Why the overlay? > view the diff with gh pr diff So what's wrong with "git diff <target>..<source>" > gh pr merge Come on.. "git co <target> ; git merge <source>" needs to be overplayed? > gh release create [tag name] Oh sure, let's overlay git flow as well. I mean overall the tool looks cute and all, but magic overlays is a no no for me.
- pbalau 6y agoConvenience. > Like, what does this do apart from a regular git clone? Why is this necessary? You can't see a difference between ```gh repo clone owner/repo``` and ```git clone git@github.com:owner/repo.git```? Also: > Something like "git clone ssh://github.com/foo/bar" followed by "gh init foo/bar" What's there to "init"? > Same goes here. Why overlaying git commands? I would have expected to just push my branch, and then call something like "gh pr create <my branch> <target branch>" From the docs: "When the current branch isn’t fully pushed to a git remote, a prompt will ask where to push the branch [...]" > Same remark again and again, what does that do apart from checking out a branch? Why the overlay? It resolves the pr # to the corresponding branch name, probably git fetch and checkout. Why should I have to know the irrelevant piece of information that is how you named your branch? > So what's wrong with "git diff <target>..<source>" How do you find out the target and source hashes? Another piece of convenience. > Come on.. "git co <target> ; git merge <source>" needs to be overplayed? And this is wrong. This merges source in target locally, ```gh pr merge``` merges it remotely. You can be Linus Torvalds, you are not going to push to my master branch.