log
Description
returns the record of commits in the Git™ repository commitHistory
= log(repo
)repo
.
specifies additional options as one or more name-value arguments.commitHistory
= log(repo
,Name=Value
)
Examples
Display History for Repository
Navigate to your repository folder and create a repository object.
repo = gitrepo;
Display the commit history for the entire repository.
commitHistory = log(repo);
Display History of File on Branch
Navigate to your repository folder and create a repository object.
repo = gitrepo;
Display the commit history for a specific file on the current branch in your repository.
commitHistory = log(repo.CurrentBranch,File="utilities\cleanup.m");
Display the commit history up to and including the revision
0fb701b
.
commitHistory = log(repo.CurrentBranch,File="utilities\cleanup.m",Revisions="0fb701b");
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: log(repo.CurrentBranch,Revisions="08a4c49")
File
— File to query
string scalar | character vector
File to query, specified as a string scalar or character vector. If you do not specify this input, the function returns the commit history for all files.
This input supports files that exist only in the repository history, even if they no longer exist on the local disk.
Example: "newfile.m"
Data Types: char
| string
Revisions
— Revision specifiers
string scalar | string vector | character vector
Revision specifiers (ID), specified as a string scalar, a string vector, or a character vector. If you do not specify this input, the function prints the commit history from the first to the most recent commit.
Commit IDs support short, full, and relative commits.
Example: "08a4c49"
,
"08a4c49d249a4dc3d998b473cdda186f1c05dfd0"
,
"08a4c49^1"
Data Types: char
| string
Output Arguments
commitHistory
— Commit history
table
Commit history, returned as a table.
Version History
Introduced in R2023b
See Also
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
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)