Skip to content

Commit 6014848

Browse files
committed
Incorporate reviewer feedback
1 parent 4f227b9 commit 6014848

File tree

6 files changed

+33
-24
lines changed

6 files changed

+33
-24
lines changed
Loading
Loading

content/desktop/contributing-and-collaborating-using-github-desktop/managing-branches.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,20 @@ If you create a branch on {% data variables.product.product_name %}, you'll need
6666
2. Click **Publish branch**.
6767
![The Publish branch button](/assets/images/help/desktop/publish-branch-button.png)
6868

69+
### Switching between branches
70+
You can view and make commits to any of your repository's branches. If you have uncommitted, saved changes, you'll need to decide what to do with your changes before you can switch branches. You can commit your changes on the current branch, stash your changes on the current branch, or bring the changes to your new branch. If you want to commit your changes on the current branch, follow the steps in "[Committing and reviewing changes to your project](/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project)" before switching branches.
71+
{% tip %}
72+
73+
**Tip**: You can set a default behavior for switching branches in the **Advanced** settings. For more information, see "[Configuring basic settings](/desktop/getting-started-with-github-desktop/configuring-basic-settings)."
74+
75+
{% endtip %}
76+
77+
{% data reusables.desktop.current-branch-menu %}
78+
{% data reusables.desktop.switching-between-branches %}
79+
![List of branches in the repository](/assets/images/help/desktop/click-branch-in-drop-down-mac.png)
80+
3. If you have saved, uncommitted changes, choose **Leave my changes** or **Bring my changes**, then click **Switch Branch**.
81+
![Switch branch with changes options](/assets/images/help/desktop/stash-changes-options.png)
82+
6983
### Deleting a branch
7084

7185
You can't delete a branch if it's currently associated with an open pull request. You cannot undo deleting a branch.
@@ -94,3 +108,4 @@ You can't delete a branch if it's currently associated with an open pull request
94108
- "[Branch](/articles/github-glossary/#branch)" in the {% data variables.product.prodname_dotcom %} glossary
95109
- "[About branches](/articles/about-branches)"
96110
- "[Branches in a Nutshell](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell)" in the Git documentation
111+
- "[Stashing changes](/desktop/contributing-to-projects/stashing-changes)"
Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,31 @@
11
---
22
title: Stashing changes
3-
intro: You can stash changes to temporarily save them without committing them to a branch.
3+
intro: You can temporarily save your changes without committing the changes to a branch by stashing the changes.
44
versions:
55
free-pro-team: '*'
66
---
77

88
### About stashed changes
9-
You can view and make commits to any of your repository's branches. If you have uncommitted, saved changes, you'll need to decide what to do with your changes before you can switch branches. You can commit your changes on the current branch, stash your changes on the current branch, or bring the changes to your new branch. If you want to commit your changes on the current branch, follow the steps in "[Committing and reviewing changes to your project](/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project)" before switching branches.
109

11-
You can stash all uncommitted changes to temporarily save the changes without committing them, and then reapply the changes later. You can only stash one set of changes at a time with {% data variables.product.prodname_desktop %}. After you stash changes on a branch, you can safely change branches or make other changes to your current branch.
10+
To apply your changes to your repository, you must save the files and then commit the changes to a branch. If you have saved changes that you are not ready to commit yet, you can stash the changes for later. When you stash changes, the changes are temporarily removed from the files and you can choose to restore or discard the changes later. You can only stash one set of changes at a time with {% data variables.product.prodname_desktop %}. If you use {% data variables.product.prodname_desktop %} to stash changes, all unsaved changes will be stashed. After you stash changes on a branch, you can safely change branches or make other changes to your current branch.
11+
12+
You can also stash changes when you switch branches. For more information, see "[Managing branches](/desktop/contributing-to-projects/managing-branches#switching-between-branches)."
1213

1314
### Stashing changes
1415

1516
{% data reusables.desktop.click-changed-files-header %}
1617
{% data reusables.desktop.click-stash-all-changes %}
1718

18-
### Switching between branches
19-
20-
{% tip %}
21-
22-
**Tip**: You can set a default behavior for switching branches in the **Advanced** settings. For more information, see "[Configuring basic settings](/desktop/getting-started-with-github-desktop/configuring-basic-settings)."
23-
24-
{% endtip %}
19+
### Restoring stashed changes
2520

26-
{% data reusables.desktop.current-branch-menu %}
27-
{% data reusables.desktop.switching-between-branches %}
28-
![List of branches in the repository](/assets/images/help/desktop/click-branch-in-drop-down-mac.png)
29-
3. If you have saved, uncommitted changes, choose **Leave my changes** or **Bring my changes**, then click **Switch Branch**.
30-
![Switch branch with changes options](/assets/images/help/desktop/stash-changes-options.png)
21+
{% data reusables.desktop.navigate-to-stashed-changes %}
22+
{% data reusables.desktop.click-stashed-changes %}
23+
3. Click **Restore**.
24+
![Restore stashed changes button](/assets/images/help/desktop/restore-stashed-changes-button.png)
3125

32-
### Retrieving stashed changes
33-
To access changes you've stashed in another branch, switch back to the branch you stashed the changes in.
26+
### Discarding stashed changes
3427

35-
{% data reusables.desktop.current-branch-menu %}
36-
{% data reusables.desktop.switching-between-branches %}
37-
![List of branches in the repository](/assets/images/help/desktop/click-branch-in-drop-down-mac.png)
38-
3. In the left sidebar, click **Stashed Changes**.
39-
![Stashed changes option](/assets/images/help/desktop/stashed-changes.png)
40-
4. To delete your stashed changes, click **Discard**, or to use your stashed changes, click **Restore**.
41-
![Discard or Restore stashed changes](/assets/images/help/desktop/discard-restore-stash-buttons.png)
28+
{% data reusables.desktop.navigate-to-stashed-changes %}
29+
{% data reusables.desktop.click-stashed-changes %}
30+
1. Click **Discard**.
31+
![Discard stashed changes button](assets/images/help/desktop/discard-stashed-changes-button.png)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1. In the left sidebar, click **Stashed Changes**.
2+
![Stashed changes option](/assets/images/help/desktop/stashed-changes.png)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1. If you are not already on the branch where the changes are stashed, click {% octicon "git-branch" aria-label="The branch icon" %} **Current Branch**, then click the branch with stashed changes.
2+
![List of branches in the repository](/assets/images/help/desktop/click-branch-in-drop-down-mac.png)

0 commit comments

Comments
 (0)