Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ versions:
### 1. Choosing a branch and making changes

1. [Create a new branch](/desktop/guides/contributing-to-projects/managing-branches), or select an existing branch by clicking {% octicon "git-branch" aria-label="The branch icon" %} **Current Branch** on the toolbar and selecting the branch from the list.

![Drop down menu to switch your current branch](/assets/images/help/desktop/select-branch-from-dropdown.png)
{% data reusables.desktop.make-changes %}

Expand All @@ -27,10 +28,13 @@ As you make changes to files in your text editor and save them locally, you will
* The yellow {% octicon "diff-modified" aria-label="The diff modified icon color-yellow" %} icon indicates modified files.
* The green {% octicon "diff-added" aria-label="The diff added icon color-green" %} icon indicates added files.
* To access stashed changes, click **Stashed Changes**.
![Stashed changes option](/assets/images/help/desktop/stashed-changes.png)

![Stashed changes option](/assets/images/help/desktop/stashed-changes.png)
* {% data reusables.desktop.commit-all-desc %}

![Select checkbox to commit all changed files](/assets/images/help/desktop/commit-all.png)
* {% data reusables.desktop.commit-some-desc %}

![Select checkboxes next to the files you want to commit](/assets/images/help/desktop/commit-some.png)

#### Creating a partial commit
Expand All @@ -44,8 +48,10 @@ If one file contains multiple changes, but you only want some of those changes t
{% endnote %}

1. To choose how your changes are displayed, in the top-right corner of the changed file, use {% octicon "gear" aria-label="The Gear icon" %} to select **Unified** or **Split**.

![Gear icon with unified and split diffs](/assets/images/help/desktop/gear-diff-select.png)
2. To exclude changed lines from your commit, click one or more changed lines so the blue disappears. The lines that are still highlighted in blue will be included in the commit.

![Unselected lines in a file](/assets/images/help/desktop/partial-commit.png)

### 3. Discarding changes
Expand All @@ -57,8 +63,10 @@ Discarded changes are saved in a dated file in the Trash. You can recover discar

{% data reusables.desktop.select-discard-files %}
{% data reusables.desktop.click-discard-files %}

![Discard Changes option in context menu](/assets/images/help/desktop/discard-changes-mac.png)
{% data reusables.desktop.confirm-discard-files %}

![Discard Changes button in the confirmation dialog](/assets/images/help/desktop/discard-changes-confirm-mac.png)

#### Discarding changes in one or more lines
Expand Down Expand Up @@ -90,15 +98,19 @@ Once you're satisfied with the changes you've chosen to include in your commit,
{% endnote %}

{% data reusables.desktop.commit-message %}

![Commit message field](/assets/images/help/desktop/commit-message.png)
2. Optionally, to attribute a commit to another author, click the add co-authors icon and type the username(s) you want to include.

![Add a co-author to the commit message](/assets/images/help/desktop/add-co-author-commit.png)
{% data reusables.desktop.commit-button %}

![Commit button](/assets/images/help/desktop/commit-button.png)
4. If the branch you're trying to commit to is protected, Desktop will warn you.
- To move your changes, click **switch branches**.
- To commit your changes to the protected branch, click **Commit to _BRANCH_**.

For more information about protected branches, see "[About protected branches](/github/administering-a-repository/about-protected-branches)".

![Protected branch warning](/assets/images/help/desktop/protected-branch-warning.png)
{% data reusables.desktop.push-origin %}