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 gh pr create Īt any time, you can add "-help" 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. winget install github.cliĪlternatively, you can grab it directly from GitHub and it's also available through the Scoop and Chocolately package managers, too. To install the GitHub CLI on Windows you can use the Windows Package Manager again by entering this into PowerShell. 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. Set "DIR_TO_DELETE=%AppData%\GitHub Desktop-Temp"įOR /D %%p IN ("%DIR_TO_DELETE%*.The GitHub CLI tool is an official GitHub application, and if you're going to be using GitHub, it's well worth having. Xcopy "%AppData%\GitHub Desktop-Temp" "%AppData%\GitHub Desktop-OtherAccount" /E /O /X /H /K /Y Set "DIR_TO_DELETE=%AppData%\GitHub Desktop-OtherAccount" Xcopy "%AppData%\GitHub Desktop-OtherAccount" "%AppData%\GitHub Desktop" /E /O /X /H /K /Y Set "DIR_TO_DELETE=%AppData%\GitHub Desktop" Xcopy "%AppData%\GitHub Desktop" "%AppData%\GitHub Desktop-Temp" /E /O /X /H /K /Y ![]() Md "%AppData%\GitHub Desktop-OtherAccount" If "%ERRORLEVEL%"="0" taskkill /F /IM GitHubDesktop.exe Tasklist /fi "ImageName eq GitHubDesktop.exe" /fo csv 2>NUL | find /I "GitHubDesktop.exe">NUL Hi, like everyone else I started using the desktop because I find it cool but the fact that it's not multi-account I find really boring, so I wrote a small bat file to switch between 2accounts ( it's very easy to use, but does the job), I'm too lazy to make a GUI lol Something worth to mention is that in the near future we're going to remove the user/password authentication mechanism and only keep the browser-based one, which can make it trickier for you to switch between accounts (you'll need to switch accounts on your browser first).Ĭan I take the opportunity to ask you what's your use case for switching between GitHub accounts, how often do you do it and how do you decide to use one account or another (is it based on the repository you're working)? Also, how do you normally manage the accounts on ? do you have multiple browsers each of them logged in with a different acount? If that would work it would be the best way.įrom what I understand, you often signout/signin using user/password to switch between different GitHub identities. Honestly, I think the best solution is to finally support multiple account signin so we won't have to type the password over and over. I'm preparing a fix for a little bit offtopic but I saw you mentioned this: ![]() Thanks for the information! I've investigated further and it looks like this issue has been present for a while, but it's possible that the previous layout of the modal didn't persuade users to press "enter" while on the user/password inputs. I just tried with the mouse several times and it didn't happen then with the enter key it did. I think you're right, it's related to the enter key. Yes, it's happening there (in Preferences window).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |