In the list of changed files, select the files where you want to discard the changes since the last commit. You can recover discarded changes until the Trash is emptied. You can discard all uncommitted changes in one or more files, or you can discard specific lines you added.ĭiscarded changes are saved in a dated file in the Trash. This will remove the changes from the files on your computer. If you have uncommitted changes that you don't want to keep, you can discard the changes. The lines that are still highlighted in blue will be included in the commit. To exclude changed lines from your commit, click one or more changed lines so the blue disappears. This allows you to make separate, meaningful commits, such as keeping line break changes in a commit separate from code or prose changes. The rest of your changes will remain intact, so that you can make additional modifications and commits. If one file contains multiple changes, but you only want some of those changes to be included in a commit, you can create a partial commit. You can toggle the checkbox with the Spacebar or Enter keys after selecting a file. To add all changes in one or more files to a single commit, unselect the checkboxes next to the files you don't want included, leaving only the files you want in the commit. To add all changes in all files to a single commit, keep the checkbox at the top of the list selected. To access stashed changes, click Stashed Changes. The yellow icon indicates modified files. In the "Changes" tab in the left sidebar: To see the entire file, right-click in the diff view and click Expand Whole File.Īs you make changes to files in your text editor and save them locally, you will also see the changes in GitHub Desktop.To see the next few lines above or below the highlighted changes, click the arrow above or below the line numbers.If you need to see more of the file than GitHub Desktop shows by default, you can expand the diff. To hide whitespace changes so you can focus on more substantive changes, select Hide Whitespace Changes.The Unified view shows changes linearly, while the Split view shows old content on the left side and new content on the right side. To change how the entire diff is displayed, under "Diff display", select Unified or Split.To change how you view diffs, in the top-right corner of the diff view, click. You can change the way diffs are displayed in GitHub Desktop to suit your reviewing needs. Using your favorite text editor, such as Visual Studio Code, make the necessary changes to files in your project. For more information, see " Configuring Git for GitHub Desktop." Choosing a branch and making changesĬreate a new branch, or select an existing branch by clicking Current Branch on the toolbar and selecting the branch from the list. If the commits you make in GitHub Desktop are associated with the wrong account on GitHub, update the email address in your Git configuration using GitHub Desktop. You can also add a co-author on any commits you collaborate on. When you make a commit, you must include a commit message that briefly describes the changes. Git assigns each commit a unique ID, called a SHA or hash, that identifies: Similar to saving a file that's been edited, a commit records changes to one or more files in your branch.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |