Package DE_EPAGES::Core::API::Git
This module provides Git commands.
Example |
my $Git = DE_EPAGES::Core::API::Git->new(); $Git->CloneRepository($RepoUrl); |
@EXPORT_OK |
Functions
- Add
- Checkout
- CloneRepository
- Commit
- CreateBranch
- ExistsLocalBranch
- ExistsRemoteBranch
- GetCommitId
- GetPatchCartridge
- GitExportRepo
- MapGitToPath
- Merge
- ProjectUpdates4GitFingerprint
- Push
- Remove
- new
Add
Add a file or directory for the next commit.
Syntax |
$self->Add($FileOrDirectory); |
Input |
|
Checkout
Checkout a branch.
Syntax |
$self->Checkout($Branch, $aArguments); |
Input |
|
CloneRepository
Clone a Git Repository.
Syntax |
$self->CloneRepository($RepoUrl, $TargetDir, $aArguments); |
Input |
|
Commit
Commit changes to current branch.
Syntax |
$self->Commit($CommitString, $aArguments); |
Input |
|
CreateBranch
Create a branch.
Syntax |
$self->CreateBranch($Branch, $aArguments); |
Input |
|
ExistsLocalBranch
Check if a branch already exists local.
Syntax |
$self->ExistsLocalBranch($Branch); |
Input |
|
Return |
|
ExistsRemoteBranch
Check if a branch already exists on remote.
Syntax |
$self->ExistsRemoteBranch($Branch); |
Input |
|
Return |
|
GetCommitId
Get the commit ID (SHA-1) of given commit (i.e. HEAD). Based on the git command rev-parse.
Syntax |
$self->GetCommitId($Commit, $aArguments); |
Input |
|
GetPatchCartridge
Get an extracted archive of the Cartridge repository (or specified Cartridge) for specified tag/branch.
Syntax |
$self->GetPatchCartridge($Tag, $TargetDir); |
Input |
|
GitExportRepo
Get an extracted archive of the Cartridge repository (or specified Cartridge) for specified tag/branch.
Syntax |
$self->GitExportRepo($BranchOrTag, $RepoTarget, $TargetDir, $TarFile, $CartridgePath); |
Input |
|
MapGitToPath
Returns hash with absolute paths in file system as key and role as value for $File in $GitRepo. $GitRepo must be one of following repositories:
- ePages-de/Cartridges
- ePages-de/epages-perl
- ePages-de/epages6-packages
- ePages-de/node-binaries
- ePages-de/node-epages6
Syntax |
$PathList = MapGitToPath($GitRepo, $File) |
Example |
{'/srv/epages/eproot/Cartridges/Cartridges.xml' => 'local'} = MapGitToPath('ePages-de/Cartridges', 'Cartridges.xml') |
Input |
|
Return |
|
Merge
Merge changes from $FeatureBranch to $MergeBranch.
Syntax |
$self->Merge($MergeBranch, $FeatureBranch, $aArguments); |
Input |
|
ProjectUpdates4GitFingerprint
Changes hash $Fingerprint according to $System, $Roles, $Node, $Dir in $Branch of $GitRepo.
Syntax |
ProjectUpdates4GitFingerprint($GitRepo, $Branch, $Fingerprint, $System, $Roles, $Node, $Dir) |
Example |
ProjectUpdates4GitFingerprint($GitRepo, \%Fingerprint, 'live', [qw(common appsrv)], 'my.host.com', "~/my-git/repo"); |
Input |
|
Push
Push current changes (file or directory) to remote.
Syntax |
$self->Push($Remote, $aArguments); |
Input |
|
Remove
Remove a file or directory for the next commit.
Syntax |
$self->Remove($FileOrDirectory); |
Input |
|
new
Create a Git object.
Syntax |
$Git = DE_EPAGES::Core::API::Git->new($hOptions); |
Return |
|