3/15/2023 0 Comments Github desktop command line![]() ![]() One way to create a Git repo is to use the git init command in the appropriate folder: cd /path/to/repo Sound good? Let’s dive in! Create a Git Repo Using the Command Line Then, we’ll explore a few tools that will abstract away the command line. First, we’ll look at a command line solution which takes advantage of the git init command. Today, we’ll look at a few different ways to create a Git repository. Then, in the future, we’ll start tackling other questions together. In this article, we’ll learn a few ways to do exactly that. For instance, what’s the command to add a description to a commit? Likewise, what’s the command for switching branches? Ultimately, I caved and started using a graphical user interface (GUI) like GitHub Desktop.Įven after throwing in the towel, I still find myself asking questions like “How do you create a Git repo from scratch?” As a result, I figured I could do myself a favor by documenting the answer. That said, when I finally got around to learning the ropes, I often found myself Googling the same questions over and over. For instance, what’s a repository? How about a branch? How are Git and GitHub different? What’s a merge conflict, and how do I fix one? These were all questions that kept me up at night. After all, there’s a lot of terminology to grasp. If at any point you need a bit more information, the -helpįlag after a command is your friend, as it'll break down everything you can do with every possible command available in GitHub CLI.When I was first learning Git, I was very confused. 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. Source: Windows Central (Image credit: Source: Windows Central) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |