fetch - Download new data from remote Git repository - MATLAB (original) (raw)
Main Content
Download new data from remote Git repository
Since R2023b
Syntax
Description
fetch([repo](#mw%5F6835e5d9-7743-4aa4-8cc8-8a1c10693863%5Fsep%5Fmw%5Faa67bf68-3ae6-4dd6-aafe-302fef14ed7f))
downloads new data from all registered remotes for the local Git™ repository repo
.
fetch([repo](#mw%5F6835e5d9-7743-4aa4-8cc8-8a1c10693863%5Fsep%5Fmw%5Faa67bf68-3ae6-4dd6-aafe-302fef14ed7f),[Name=Value](#namevaluepairarguments))
specifies additional options as one or more name-value arguments.
Examples
Navigate to your repository folder and create a repository object.
Download new data from all registered remotes.
To fetch from a passphrase-protected remote repository, specify your login information for the Git repository account, for example GitHub®. For more information, see Download Data from Specified Remote.
Navigate to your repository folder and create a repository object.
Download new data from the origin
remote on a passphrase-protected repository.
secrets = loadenv("github.env"); fetch(repo,Username=secrets("GITHUB_USER"),Token=secrets("GITHUB_TOKEN"),Remote="origin");
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
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: fetch(repo,Username="myusername",Token="mypersonaltoken",Remote="origin")
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
Name of the remote from which the function downloads data, specified as a character vector or string scalar.
Data Types: char
| string
Version History
Introduced in R2023b