![]() Modified files are shown with a yellow dot in a square.The header of the list displays a file count, like “3 changed files,” as displayed in the screenshot below.ĭifferent types of changes are represented by icons to the right of each file name. The Changes panel lists every changed file in your working directory. Step 3 - Selecting changes to commit #īefore committing, you can choose which changed files you want to include in the commit. Once we’ve selected a branch, its name will be displayed in the Current Branch tab. ![]() For example, if we’re planning to commit some changes to the README.md file in our repository, we could use the New Branch button to create a new branch and name it update-readme. When thinking about creating and titling a new branch, consider having it describe what the new code will be doing. Creating a new branch can be useful if you’re working on a new feature and want to keep your changes independent of the main branch, or if you’re making some experimental changes. If you want to create a new branch before committing, use the New Branch button in the Current Branch panel. ![]() You can click on this tab to switch branches or to create a new branch. The current branch is displayed on the Current Branch tab. Next, ensure that the current branch is the one where you intend to make your commit. This will also add it to the list of repositories.Īfter following these steps, your repository’s name should now appear under Current Repository in the top toolbar. Browse to the location of your repository in the file system.Īlternatively, you also have the option of cloning a remote repository hosted on GitHub or another source by selecting Clone Repository from the Add dropdown.Select Add Existing Repository in the dropdown menu.Click the Add button in the Current Repository panel.To add a local repository from your file system, open the Current Repository panel by clicking on it in the top toolbar and following these steps: If you created or cloned your local repository with a tool other than GitHub Desktop, like the Git command-line interface, you’ll need to manually add your repository to GitHub Desktop to be able to access it in the application. Adding a local repository to GitHub Desktop # If the repository is not in the list, you’ll need to add it manually, as explained in the next section. Once your repository is selected, its name will appear on the Current Repository tab, and you can proceed to Step 2 - Selecting a branch. If the repository that you want to commit to is in the list, click on it to select it. This will display a list of repositories that you can choose from. To select an added repository, open the Current Repository panel by clicking on it in the top toolbar. If you previously used GitHub Desktop to create or clone a repository or have manually added it, it will appear in the list of added repositories. Selecting a repository already present in GitHub Desktop # ![]() This section will provide you with the steps needed to select your desired repository. ![]() In the screenshot below, that repository is titled javascript-demo. The name of the currently selected repository is displayed in the Current Repository tab in the top toolbar of the application. If you have multiple local repositories, GitHub Desktop lets you switch between them to select the one you want to work on. If you don’t yet have a Git repository on your computer, you can review the official documentation for “ Getting a Git Repository.” Step 1 - Opening a repository in GitHub Desktop # To follow this tutorial, you should already have a local Git repository on your computer and have made some changes that you want to commit. You can install it by going to the GitHub Desktop website and selecting the version of the software relevant to your operating system. Prerequisites #īe sure that you have GitHub Desktop installed. In this tutorial, we’ll go through how to commit code to a Git repository using GitHub Desktop. It can also clone, push, and pull remote repositories hosted on GitHub and elsewhere. GitHub Desktop is an application that provides a graphical interface to interact with Git repositories on your computer, providing an alternative to using Git on the command line. Committing code with Git allows you to version control your own work, collaborate with other developers, and contribute to open source projects. ![]()
0 Comments
Leave a Reply. |