fetch
Description
fetch(
downloads new data from all
registered remotes for the local Git™ repository repo
)repo
.
fetch(
specifies additional options as one or more name-value arguments.repo
,Name=Value
)
Examples
Download Data from All Registered Remotes
Navigate to your repository folder and create a repository object.
repo = gitrepo;
Download new data from all registered remotes.
fetch(repo);
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.
Download Data from Specified Remote
Navigate to your repository folder and create a repository object.
repo = gitrepo;
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, see Manage Git Credentials.
Input Arguments
repo
— Git repository
matlab.git.GitRepository
object
Git repository, specified as a matlab.git.GitRepository
object.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=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
— Username for Git repository account
character vector | string scalar
Username for the Git repository account, specified as a character vector or string scalar.
Data Types: char
| string
Token
— Personal access token for Git repository account
character vector | string scalar
Personal access token for the Git repository account, specified as a character vector or string scalar.
Data Types: char
| string
Remote
— Remote name
character vector | string scalar
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
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)