Most of GitHub's main features can be interacted with using the CLI tool. We have a full beginner's guide to GitHub that's a good companion to this, but once you're comfortable with the basics there's a lot to explore. There's a lot more to GitHub CLI than we've talked about here, but hopefully, this gets you pointing in the right direction, particularly if you're a beginner to using GitHub at all. Pull requests behave in exactly the same way as on the web, so naturally won't work if you're on the master branch. If you wanted to create a pull request and continue it on the web, for example, you would enter: gh pr create -w To the above to get a full breakdown of all available options. There are a number of options you have when creating pull requests in GitHub CLI, but the basic template is as follows. Again, all the steps are the same whether you use Windows or WSL. To authenticate GitHub CLI, open up your terminal and follow these steps. The GitHub CLI, unlike Git, can use your account login and password for authentication with the added bonus of then also allowing Git to push to your GitHub repositories. How to set up GitHub CLI and authenticate your account The two operate the same way, but if you switch between WSL and PowerShell you'll need to have it installed in both locations. curl -fsSL | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpgecho 'deb stable main' | sudo tee /etc/apt//github-cli.list > /dev/nullsudo apt updatesudo apt install ghĪs with Git, the WSL installation of the GitHub CLI is separate from the Windows installation you would use in PowerShell. Since most people using WSL are likely to have Ubuntu or Debian installed as they're officially distributed through the Microsoft Store, you can use the following commands in your WSL terminal to install it. On WSL, the process is a little more involved, but GitHub has full documentation you can follow. Alternatively, it's available through the Scoop and Chocolately package managers, too, where you'll simply need to install gh To install the GitHub CLI on Windows you can use the Windows Package Manager again by entering winget install github.cli For one, it gets around using personal access tokens with Git to push local repositories up to GitHub, as you can use the GitHub CLI application to authenticate your whole system. The GitHub CLI tool is an official GitHub application, and if you're going to be using GitHub, it's well worth having. If I enforce writing a comment instead of merging, that will surely create friction and mistakes.Source: Windows Central (Image credit: Source: Windows Central) There is an action on the marketplace that triggers on PR comment here as an example of what I'm trying to do, but I want to be able to click the merge button. Just trying to brainstorm my options, if any. Is something possible to solve this problem, and is there any way to implemented the proposed solution? I've considered triggering an action on pull_request.closed status but I believe that would trigger after the commit, requiring some rewriting shenanigans if I went that route and was correct about the order of operations. If I can get an action to trigger when I click "Rebase and Merge", maybe I can change the commit to be fast-forwarded instead. Idea: Change the behavior of the "Rebase and Merge" merge option with an action. Not letting devs press the merge button for PRs sucks, and having to do it via CLI also sucks. Knowing this, I'd like to make a GitHub Action that can make doing this more convenient. So, this is possible but must be done with git CLI. The PR option "Rebase and Merge" rewrites the commit time and author for the rebased commits.įrom the GitHub Documentation, it says "A workaround for this is to rebase and merge locally, and then push the changes to the pull request's base branch." here. Problem: it's not possible to do a fast-forward rebase merge using the GitHub UI.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |