Synchronizing with a remote Git repository
Before you can share the results of your work by pushing your changes to the upstream, you need to synchronize with the remote repository to make sure your local copy of the project is up to date. You can do this in one of the following ways: fetch or pull changes, as well as sync the local project with the remote.
Synchronizing by using the branch menu
Click the Current Branch menu, navigate to your branch, and click the vertical ellipsis icon ().
For the currently selected branch, you can select from the following list of actions:
Push: sends your local commits to the remote repository. Use this to share your changes with other team members.
Pull: retrieves the latest changes from the remote repository and merges them into your current branch. This ensures your branch is up to date with the remote.
Pull & Push: performs a pull followed by a push. This ensures your branch is synchronized with the remote repository by fetching the latest changes, merging them, and then sending your updates.
Fetch: downloads the latest changes from the remote repository without merging them into your current branch. Use this to review the changes before integrating them.
For non-selected branches, you can select from the following list of actions:
New branch from <branch_name>: creates a new branch based on the selected branch. Use this to start a new line of development without modifying the original branch.
Compare with current branch: compares the selected branch with your current branch to review the differences.
Show Diff with Working Tree: displays the differences between the selected branch and the current state of your working directory.
Push: sends the commits of the selected branch to the remote repository.
Fetch: retrieves the latest updates from the remote repository for the selected branch without merging them.
Delete: deletes the selected branch.
Fetch changes
When you fetch changes from the upstream, all new data from commits that were made since you last synced with the remote repository is downloaded into your local copy. This new data is not integrated into your local files, and changes are not applied to your code.
Fetched changes are stored as a remote branch, which gives you a chance to review them before you merge them with your files. Since fetch does not affect your local development environment, this is a safe way to get an update of all changes to a remote repository.
There are two ways to fetch changes from the upstream:
Select Git | Fetch from the main menu.
Alternatively, in the Branches menu, click the name of the branch that is currently checked out, then choose Remote Branches | Fetch.
Pull
If you need to get changes into the current branch from the remote tracked branch, use pull.
Before performing git pull
, Fleet automatically saves your uncommitted changes by stashing them.
To pull changes into the local branch from the remote tracked branch:
Check out the branch you want to update by clicking its name in the Branches menu.
Choose Git | Pull in the main menu or Press ⌃ G,⌃ U.
Sync
The Unsynced commits tab is a part of the Git tool. It helps you synchronize the local branch with the remote tracked branch.
After you perform the fetch operation, this tab will indicate if there are any unsynchronized commits between your local branch and the remote tracked branch.
To synchronize the changes between your local branch and the remote tracked branch:
In the Unsynced commits tab, click Sync.
In the Git Sync dialog that opens, confirm the operation by choosing Sync.
First, Fleet pushes local changes to the remote tracked branch. Then, if the remote branch also contains unsynchronized commits, Fleet pulls them into the local branch.