About branch synchronization
You can sync your local branch with the remote repository by pulling any commits that have been added to the branch on GitHub since the last time you synced. If you make commits from another device or if multiple people contribute to a project, you will need to sync your local branch to keep the branch updated.
When you pull to your local branch, you only update your local copy of the repository. To update your branch on GitHub, you must push your changes. For more information, see "Pushing changes to GitHub."
To add changes from one branch to another branch, you can merge the branches. To apply changes to your branch from another branch in the same repository, you can merge the other branch into your branch on GitHub Desktop. To request that changes from your branch are merged into another branch, in the same repository or in another repository in the network, you can create a pull request on GitHub Desktop. For more information, see "Merging another branch into your project branch" and "About pull requests."
Some workflows require or benefit from rebasing instead of merging. リベースすることで、コミットの順序を変更したり、編集したり、まとめて squash したりできます。 For more information, see "About Git rebase" and "Rebasing your project branch onto another branch."
Pulling to your local branch from the remote
- In GitHub Desktop, use the Current Branch drop-down, and select the local branch you want to update.
- To check for commits on the remote branch, click Fetch origin

- To pull any commits from the remote branch, click Pull origin or Pull origin with rebase.
![[Pull origin] ボタン](/anna-https-web.archive.org/web/20200811200733im_/https://docs.github.com/assets/images/help/desktop/pull-button.png)
- テキストエディタ、コマンドライン、または他のツールなどの好みの方法で、マージコンフリクトがあれば解決してください。 For more information, see "Addressing merge conflicts."
Merging another branch into your project branch
-
In GitHub Desktop, click Current Branch.

-
Choose a branch to merge into BRANCH(BRANCHにマージするブランチの選択)をクリックしてください。

-
現在のブランチのマージしたいブランチをクリックし、Merge BRANCH into BRANCH(ブランチにブランチをマージ)をクリックしてください。
注釈:マージコンフリクトがある場合、GitHub DesktopはMerge BRANCH into BRANCHボタンの上に警告を表示します。 全てのコンフリクトを解決するまではブランチをマージすることはできません。

-
Click Push origin to push your local changes to the remote repository.

Rebasing your project branch onto another branch
- In the menu bar, use the Branch drop-down and click Rebase Current Branch.
![ブランチのドロップダウンメニューにある [Rebase Current Branch]](/anna-https-web.archive.org/web/20200811200733im_/https://docs.github.com/assets/images/help/desktop/mac-rebase-current-branch.png)
- 現在のブランチにリベースしたいブランチをクリックし、[Start rebase] をクリックします。
![[Start rebase] ボタン](/anna-https-web.archive.org/web/20200811200733im_/https://docs.github.com/assets/images/help/desktop/start-rebase-button.png)
- リベースしたい場合は、[Begin rebase] をクリックします。
![[Begin rebase] ボタン](/anna-https-web.archive.org/web/20200811200733im_/https://docs.github.com/assets/images/help/desktop/begin-rebase-button.png)
- テキストエディタ、コマンドライン、または他のツールなどの好みの方法で、マージコンフリクトがあれば解決してください。 For more information, see "Addressing merge conflicts."
- To push your local changes, click Force push origin.
![[Force push origin]](/anna-https-web.archive.org/web/20200811200733im_/https://docs.github.com/assets/images/help/desktop/force-push-origin.png)
- [Branch] ドロップダウンメニューで、[Rebase Current Branch] をクリックします。
![ブランチのドロップダウンメニューにある [Rebase Current Branch]](/anna-https-web.archive.org/web/20200811200733im_/https://docs.github.com/assets/images/help/desktop/windows-rebase-current-branch.png)
- 現在のブランチにリベースしたいブランチをクリックし、[Start rebase] をクリックします。
![[Start rebase] ボタン](/anna-https-web.archive.org/web/20200811200733im_/https://docs.github.com/assets/images/help/desktop/start-rebase-button.png)
- リベースしたい場合は、[Begin rebase] をクリックします。
![[Begin rebase] ボタン](/anna-https-web.archive.org/web/20200811200733im_/https://docs.github.com/assets/images/help/desktop/begin-rebase-button.png)
- テキストエディタ、コマンドライン、または他のツールなどの好みの方法で、マージコンフリクトがあれば解決してください。 For more information, see "Addressing merge conflicts."
- ローカルの変更をプッシュするには、[Force push origin] をクリックします。
![[Force push origin]](/anna-https-web.archive.org/web/20200811200733im_/https://docs.github.com/assets/images/help/desktop/force-push-origin.png)

