AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Github cli9/18/2023 ![]() To view the complete lists of the gh pr commands, do visit the docs here The gh pr command is used to work with GitHub pull requests, and it comes with lots of subcommands, such as: If you'll like to know more about how the other subcommand are to be used, please read up on their docs here gh pr c: specifies you'll like to clone the repo once it's created ⬇️ d : specifies description for the repo ✍️ ![]() private: specifies, hey repo, be a private repo □ add-readme: specifies you want a Readme file added to the repo, obviously □ Notice I have 4 flags along with the repository name gh repo create new_repo -add-readme -private -d "Hello this is a new repo" -c Now, let's create a new repository just like we've done before, but this time in a non-interactive mode whereby there is no step-by-step procedure and no questions. The non-interactive mode is a declarative way of specifying how the repo should be created, where the name and various flags would be specified. Let's look at a step-by-step guide using the interactive mode command: Note the interactive mode doesn't take arguments, so only the command gh repo create is used. The interactive mode means you'd go through a list of questions like whether you want to clone the repo after it's been created, whether it should be a private or public repo, and other questions. ![]() : specifies particular arguments for the repository being created, for example, making the repo public or privateīefore we run the commands, you should know that there are two modes of using this command: the interactive mode and the non-interactive mode. : specifies the name of the repository while The command above is to create a repository, making it private and public, with flags and lots of other cool stuff concerning a repository beyond this article's scope. Let's go over just one of the subcommands under the gh repo command: gh repo create To view the complete lists of the gh repo commands, do visit the docs here The gh repo command is used for handling repositories, and it comes with lots of subcommands, such as: There are a lot of commands that serve different GitHub operations, so we aren't going to cover all we'll look at two commands, which I offend make use of. : specifies additional options or arguments to the command. Subcommand: specifies further commands that complete the command essentially. Gh: is the initial command, saying I want to use GitHub CLIĬommand: specifies the action you'll like to take, like login, pr (pull request), browse e.t.c The GitHub CLI commands follow a certain basic syntax or usage, which is: When you run the command above, you'll get more prompt the images below work you through the steps Now that we got the CLI on our various machines, we need to be authenticated with our GitHub accounts to utilise the CLI.įirstly, run the command on the terminal gh auth login winget install -id GitHub.cliįor further instructions on how to install the GitHub CLI, please visit their documentation Configuring GitHub CLI But if you're on Windows 10 upwards, you should have WinGet by default. You can use these package managers or command line installers such as WinGet, and scoop, which of course, must be installed first on your machine. ![]() There are various means of installing the GitHub CLI on our devices depending on the Operating System (OS) you make use of. Basic knowledge of the terminal or the Command Line Interface (CLI).The GitHub CLI is a tool that takes Github to the command line, allowing us to perform GitHub operations such as making a pull request (PR), creating repositories (repo) etc., that would have been done on the GitHub website directly. The GitHub CLI is a tool I've been using recently, and I doubt many of us developers are aware of it, so we'll be looking at some of its use cases which would help boost your productivity when it comes to using Github. We all know about Github, I presume but do we know about the Github CLI (Command Line Interface)? ![]()
0 Comments
Read More
Leave a Reply. |