pull - Download and merge new data from remote Git repository into local repository - MATLAB (original) (raw)

Main Content

Download and merge new data from remote Git repository into local repository

Since R2023b

Syntax

Description

pull([repo](#mw%5F68pull35e5d9-7743-4aa4-8cc8-8a1c10693863%5Fsep%5Fmw%5Faa67bf68-3ae6-4dd6-aafe-302fef14ed7f)) downloads new data from the remote Gitâ„¢ repository repo that the current branch tracks. Thepull function attempts to automatically merge all pulled commits into the currently checked-out branch in your local repository. If the merge results in file conflicts, the pull function reports that the merge is incomplete. To complete the merge, resolve and commit the conflicted files.

example

pull([repo](#mw%5F68pull35e5d9-7743-4aa4-8cc8-8a1c10693863%5Fsep%5Fmw%5Faa67bf68-3ae6-4dd6-aafe-302fef14ed7f),[Name=Value](#namevaluepairarguments)) specifies additional options as one or more name-value arguments.

example

Examples

collapse all

Navigate to your repository folder and create a repository object.

Pull new data from the remote Git repository that the current branch tracks.

Navigate to your repository folder and create a repository object.

Pull new data from a passphrase-protected remote repository.

secrets = loadenv("github.env"); pull(repo,Username=secrets("GITHUB_USER"),Token=secrets("GITHUB_TOKEN"));

To prevent frequent login prompts when you interact with your remote repository using HTTPS, configure a Git credential manager to remember credentials. For more information, seeManage Git Credentials.

Input Arguments

Name-Value Arguments

collapse all

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: pull(repo,Username="myusername",Token="mypersonaltoken")

Username for the Git repository account, specified as a character vector or string scalar.

Data Types: char | string

Personal access token for the Git repository account, specified as a character vector or string scalar.

Data Types: char | string

Version History

Introduced in R2023b