Pull might fail if you have conflicts. With a complicated change you might want to create a
branch from the origin, make some compatibility changes, then merge that branch into
the main tracking branch.
To commit changes to the local repository, right-click the Current Folder browser and
select Source Control > View and Commit Changes.
To see if your local changes have moved ahead of the remote tracking branch, right-click
the file or white space of the Current Folder browser and select Source Control > View
Details. The Git information field indicates whether your committed local changes are
ahead of, behind, or coincident with the remote tracking branch.
To send local commits to the remote repository, right-click in the Current Folder browser
and select Source Control > Push. A message appears if you cannot push your changes
directly because the repository has moved on. Right-click in the Current Folder browser
and select Source Control > Fetch to fetch all changes from the remote repository.
Merge branches and resolve conflicts, and then you can push your changes.
Using Git, you cannot add empty folders to source control, so you cannot select Push and
then clone an empty folder. You can create an empty folder in MATLAB, but if you push
changes and then sync a new sandbox, then the empty folder does not appear in the new
sandbox. To push empty folders to the repository for other users to sync, create a
gitignore file in the folder and then push your changes.
Fetch and Merge
Use Fetch to get changes and merge manually. Use Pull instead to fetch the latest
changes and merge them into your current branch.
NoteAfter fetching, you must merge. Before you can merge branches, you must install
command-line Git and register binary files to prevent Git from inserting conflict markers.
See “Install Command-Line Git Client” on page 32-31.
To fetch changes from the remote repository, right-click in the Current Folder browser
and select Source Control > Fetch. Fetch updates all of the origin branches in the local
repository. Your sandbox files do not change. To see others’ changes, you need to merge in
the origin changes to your local branches.
For information about your current branch relative to the remote tracking branch in the
repository, right-click the file or white space of the Current Folder browser and select
32 Source Control Interface