With authentication done and configs set, let us now explore how to create and manage Repositories.Ĭreating and Managing GitHub Repositories “ gh config get git_protocol” will display “ https” for me. We can view the config values using the command: “ gh config get ”. Gh config set prompt (To disable interactive prompts. Gh config set git_protocol (To set our preferred git protocol. Gh config set editor (To set our preferred editor. To set our preferred “gh” configuration, there are a set of commands: To logout from the GitHub host, we have to run the command: “ gh auth logout”. We can check the information regarding the authentication state using the command: “ gh auth status” and also refresh the stored authentication credentials using the command: “ gh auth refresh”. Once it is done, we will be asked to select default git protocol (between “HTTPS” and “SSH”). Once we select browser, it will ask us to open the browser, paste the generated one-time code there, authorize and enter GitHub credentials to authenticate. After selecting, it will ask to authenticate using our default browser or using authentication token. It will prompt us to choose from the Enterprise Server or the non-enterprise version. For demo purpose, I will be using my GitHub account ( ).įirst, we need to authenticate ourselves with the GitHub host using the command “ gh auth login”. Let’s now start working with the GitHub CLI commands and you will see how easy it is to perform the actions from the terminal. ( Note: There is an unofficial GitHub tool ( hub – ) which also brings GitHub to the terminal but the difference is that with a fundamentally different design, “gh” is GitHub- official standalone tool, whereas “hub” acts as a proxy to git).Ī Step-by-Step working with the “gh” commands To check successful installation in Windows, run the command: gh –version You can also download it using Chocolatey and Scoop package managers.įor MAC, run the Home brew command: brew install gh and for installing in various Linux distributions, you can refer to the page: Since I am using Windows, I downloaded the Windows Installer package (.msi) from the official site and installed it in my system following the standard installation process. Installing GitHub CLI in your system is a very easy process. This will help you to focus on your scripting/ GitHub workflows by reducing context switching from terminal to browser and vice-versa. With the help of numerous ‘ gh’ commands, GitHub CLI will help you to manage GitHub Repositories, Pull Requests, Issues, Releases and Reviews from the terminal itself (where you already work with the “ git” commands). GitHub CLI (Command Line Interface) is a free and open-source program that brings GitHub to your terminal and will help you to easily and seamlessly work with GitHub from the command line. Out of the beta, GitHub has just released GitHub CLI 1.0.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |