Skip to content
CA Release Automation - Integrations
Documentation powered by DocOps

Git

Last update May 18, 2016

Action Pack for Git 10.4.1507

The Action Pack for Git contains actions that enable you to create workflow processes that perform operations in Git.

Actions Implementation

The Git actions are executed by running Git.exe from the command line.

Agent Installation

The Agent must be installed on the server where Git is installed.

Default Ports

The following (default) ports between the Execution Server and the Agent must be open for communication for the actions in this action pack to work:

  • TCP 6600

Actions Help

For a list of input and output descriptions for deployed actions, refer to:

  • Git Actions in this document
  • The embedded actions help that is available in your installation at http://<yourdeployment>/nolio-app/actionshelp.jsp.

Supported Platforms:

  • Git actions in this pack support Git 1.x and later
  • Git actions in this pack support CA Release Automation 5.0 and later
  • Windows 2008 R2, Linux Red Hat 6.0, and CentOS 6.4

What's New

The following updates were made for 10.4.1507.

    Git actions with empty username and password supported.

The following update was made for 10.3.1503.

  • The action, "Git - Clone", updated to not allow the use of useless characters in the command line.

Install the Action Pack

Install and use these actions to execute commands and tasks in Git.

Follow these steps:

  1. Deploy the action pack for Git.
    For more information, see Manage Action Packs and Plug-ins.
  2. Use Git actions in CA Release Automation processes.

Git Actions

The Action Pack for Git contains the following actions.

Git - Add File Contents

Use the Git add command to add file contents to the staging area.

Name Type Description
* Files List String[] Files to add content from. Fileglobs (For example, *.c) can be given to add all matching files. Also a leading directory name (For example, dir to add dir/file1 and dir/file2) can be given to add all files in the directory, recursively.
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Timeout Duration long Time to wait for the action in seconds.
Use --all Flag Boolean Update the index not only where the working tree has a file matching <pathspec> but also where the index already has an entry. Adds, modifies, and removes index entries to match the working tree.
Use --force Flag Boolean Allow adding otherwise ignored files.
Use --ignore-errors Flag Boolean If some files could not be added because of errors indexing them, do not abort the operation, but continue adding the others.
Use --ignore-removal Flag Boolean Ignore files that have been removed from the working tree.
Use --intent-to-add Flag Boolean Record only the fact that the path is added later. An entry for the path is placed in the index with no content.
Use --no-ignore-removal Flag Boolean Update the index not only where the working tree has a file matching <pathspec> but also where the index already has an entry. Adds, modifies, and removes index entries to match the working tree.
Use --refresh Flag Boolean Do not add the file(s), but only refresh their stat() information in the index.
Use --update Flag Boolean Update the index only where it already has an entry matching files list. Removes and modifies index entries to match the working tree, but adds no new files.

Git - Branch

Lists, creates, or deletes branches.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Branch Color Options GitBranchAction$ColorOptions Branch Color Options
Branch Create Options GitBranchAction$CreateOptions Branch Create Options
Branch Delete Options GitBranchAction$DeleteOptions Branch Delete Options
Branch List Abbreviate Options String Branch List Abbreviate Options
Branch List Column Options String Branch List Column Options
Branch List Extra Options GitBranchAction$ListExtraOptions Branch List Extra Options
Branch List Options GitBranchAction$ListOptions Branch List Options
Branch List Patterns(Commit) String Branch List Patterns(Commit)
Branch Move Options GitBranchAction$MoveOptions Branch Move Options
Branch Name String Branch Name
Branch Name String Old Branch Name
Create Force Option Boolean Create Force Option
Create reflog Option Boolean Create reflog Option.
Timeout Duration long Time to wait for the action in seconds.
Unset Upstream Option Boolean Unset Upstream Option
Upstream Name String Upstream Name
Verbose Options GitBranchAction$VerboseOptions Verbose Options

Git - Checkout

Checkout a branch or paths to the working tree.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Checkout Options String Checkout Options. Example: -b <new_branch>
Timeout Duration long Time to wait for the action in seconds.

Git - Clean

Removes untracked files from the working tree.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Clean Run Directory Option Boolean Remove untracked directories in addition to untracked files.
Clean Run Ignored Files Option Boolean Remove only files that are ignored by Git.
Clean Run Ignored Files config Option Boolean Do not use the standard ignore rules that are read from .Gitignore (per directory) and $Git_DIR/info/exclude, but do still use the ignore rules that are given with -e options.
Clean Run Options GitCleanAction$RunOption Clean Run Options
Clean Run Quiet Option Boolean Clean Run Quiet Option
Ignored Files Pattern String These patterns to be in the set of the ignore rules in effect.
Path String Only those paths are affected.
Timeout Duration long Time to wait for the action in seconds.

Git - Clone

Clones a repository into a new directory.

Note: We recommend that you populate the Branch value. For example, master

When given, and the repository to clone from is accessed via ssh, specifies a non-default path for the command that is run on the other end.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Repository String The (possibly remote) repository to clone from. Example: Git://Github.com/schacon/simpleGit.Git
* Working Folder String The working directory is the checkout location on your disk.
Addtional Option GitCloneAction$AddtionalOptions Additional Clone Options
Branch String Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository HEAD, point to <name> branch instead
Cloning to Directory String The name of a new directory to clone into, Cloning into an existing directory is only allowed if the directory is empty. If empty, cloning uses the working folder.
Config String[] Set a configuration variable in the newly created repository.
Depth Integer Create a shallow clone with a history truncated to the specified number of revisions.
New Name String Instead of using the remote name origin to keep track of the upstream repository, use <name>
Option GitCloneAction$Options Clone options when the repository to clone from is on a local server, could be |local|no-hardlinkshared |shared.
Recursive Boolean Create a shallow clone with a history truncated to the specified number of revisions.
Reference String If the reference repository is on the local server, automatically setup.
Remote Repository user name String Remote repository user name
Remote Repository user password Password Remote repository user password
Separate -Git -dir String Instead of placing the cloned repository where it is supposed to be, place the cloned repository at the specified directory, then make a filesytem-agnostic Git symbolic link to there.
Single -branch Boolean Clone only the history leading to the tip of a single branch, either specified by the --branch option or the primary branch remote HEAD points at
Template String Specify the directory from which templates are used
Timeout Duration long Time to wait for the action in seconds.
Upload _pack String
Verbose Options GitCloneAction$VerboseOptions Verbose Options
Name Type Description
Clone Output String Clone Output

Git - Commit

Records change to the repository.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Allow Empty Commit Boolean Usually recording a commit that has the exact same tree as its sole parent commit is a mistake, and the command prevents you from making such a commit. This option bypasses the safety, and is primarily for use by foreign SCM interface scripts.
Commit Author String Specify an author if you want to commit as an author other than the current committer.
Commit Date String Specify a date and override the author date that is used in the commit. The date format example '2013-04-07T22:13:13'.
Files List String[] When files are given on the command line, the command commits the contents of the named files, without recording the changes already staged. The contents of these files are also staged for the next commit on top of what have been staged before.
Message String Message String for committing. Empty message is allowed.
Message Clean Up Mode GitCommitAction$CleanUpMode Message cleanup mode.
Message File String Use the messages in a file as the commit message. File that contains messages for committing. Empty message is allowed.
Timeout Duration long Time to wait for the action in seconds.
Use --all Flag Boolean Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.
Use --amend Flag Boolean Replace the tip of the current branch by creating a commit.

Git - Configure User Email Address

Configures user Email address.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* User email Address String User email Address. For example, user@example.com.
* Working Folder String The working directory is the checkout location on your disk.
Timeout Duration long Time to wait for the action in seconds.

Git - Configure User Name

Configures user name.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* User Name String Git user name.
* Working Folder String The working directory is the checkout location on your disk.
Timeout Duration long Time to wait for the action in seconds.

Git - Execute Git Command

Executes a general Git command.

Name Type Description
* Command Arguments String The Git command arguments. Start with sub-command. For example, "add ."
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Timeout Duration long Time to wait for the action in seconds.
Name Type Description
Output String The output of Git command.

Git - Initiate a Local Repository

Creates an empty Git repository or reinitialize an existing one.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Create Bare Repository Boolean Create a bare repository. If Git_DIR environment is not set, it is set to the current working directory.
Share Repository String Value can be false|true|umask|group|all|world|everybody|0xxx. By default the repository is not shared(value is false).
Template Directory String Specify the directory from which templates are used. Left it blank if you do not use a template.
Timeout Duration long Time to wait for the action in seconds.

Git - Log

Shows the commit logs.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Log Options String Log Options
Log Path String Log Path
Log Revision Range String Log Revision Range
Timeout Duration long Time to wait for the action in seconds.
Name Type Description
Log Output String Log Output

Git - Merge

Joins two or more development histories together.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Merge Commit Message String Merge Commit Message
Merge Commit Option GitMergeAction$CommitOptions Merge Commit Option
Merge Fast Forward Option GitMergeAction$FastForwardOptions Merge Fast Forward Option
Merge Log Commit Count Option Integer Merge Log Commit Count Option
Merge Other Branch Head String Merge Other Branch Head
Merge Rerere Options GitMergeAction$RerereAutoupdateOptions Allow the rerere mechanism to update the index with the result of auto-conflict resolution if possible.
Merge Sign Value String Merge Sign Value
Merge Signature Option GitMergeAction$VerifySignatureOptions Git Merge Signature Option
Merge Squash Option GitMergeAction$SquashOptions Merge Squash Option
Merge Stat Option Boolean Merge Stat Option
Merge Strategy String Merge Strategy
Merge Strategy Option String Merge Strategy Option
Timeout Duration long Time to wait for the action in seconds.
Name Type Description
Merge Output String Merge Output

Git - Move

Moves or renames files, directories, or symlinks to an existing directory.

Name Type Description
* Destination Directory String Specifies the destination file or directory. If you want to move files to the destination directory, the destination directory is required to exist.
* Files List String[] Specifies the file list to be moved or renamed. If you want to rename a file, the list contains only one file.
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Force Moving Boolean Force moving of a file even if the target exists.
Skip Files On Error Condition Boolean Skip move or rename actions which would lead to an error condition. An error happens when a source is neither existing nor controlled by Git, or when it would overwrite an existing file unless -f is given.
Timeout Duration long Time to wait for the action in seconds.

Git - Pull

Fetches from and integrates with another repository or a local branch.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Repository String Incorporates changes from a remote repository into the current branch
* Working Folder String The working directory is the checkout location on your disk.
Pull Options(fetching) String Git Pull Options(fetching)
Pull Options(merging) String Git Pull Options(merging)
Pull Recursive Option GitPullAction$RecursiveOptions This option controls if new commits of all populated submodules are fetched.
Remote Repository user name String Remote repository user name
Remote Repository user password Password Remote repository user password
Timeout Duration long Time to wait for the action in seconds.
Verbose Options GitPullAction$VerboseOptions Verbose Options

Git - Push

Updates remote refs and associated objects.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Repository String The remote repository that is destination of a push operation
* Working Folder String The working directory is the checkout location on your disk.
Push Options GitPushAction$Options Push Options
Push Recursive Option GitPushAction$RecursiveOptions Make sure that all submodule commits used by the revisions to be pushed are available on a remote-tracking branch.
Push Thin Options GitPushAction$ThinOptions Push Thin Options
Push Verify Options GitPushAction$VerifyOptions Push Verify Options
Receive -pack String Path to the Git-receive-pack program on the remote end
Remote Repository user name String Remote repository user name
Remote Repository user password Password Remote repository user password
Timeout Duration long Time to wait for the action in seconds.
Verbose Options GitPushAction$VerboseOptions Verbose Options
Name Type Description
Push Output String Push Output

Git - Remove

Removes files from the working tree and from the index.

Name Type Description
* Files List String[] Files to remove. Fileglobs (For example, *.c) can be given to remove all matching files.
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Cached Boolean Use this option to unstage and remove paths only from the index. Working tree files, whether modified or not, are left alone.
Force Boolean Override the up-to-date check.
Ignore Unmatch Boolean Exit with a zero status even if no files matched.
Recursive Boolean Allow recursive removal when a leading directory name is given.
Timeout Duration long Time to wait for the action in seconds.

Git - Remove Remote Name

Removes the remote name. All remote-tracking branches and configuration settings for the remote are removed.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Name String The name of remote repository
* Working Folder String The working directory is the checkout location on your disk.
Timeout Duration long Time to wait for the action in seconds.

Git - Reset File Contents

Resets only the index. To reset a commit, use the 'Undo Commit' action.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Files List String[] Input one file in a row. Left this field blank if you want to reset all files in the working directory.
Timeout Duration long Time to wait for the action in seconds.
Tree-ish Parameter String For example, HEAD~3. Default value is HEAD.

Git - Revert

Reverts current HEAD to the specified state.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
New Branch Head String New Branch Head
Path String Only those paths are affected.
Reset Mode GitResetAction$ResetMode Reset Mode
Reset Quiet Option Boolean Reset Quiet Option
Timeout Duration long Time to wait for the action in seconds.
Tree-ish Parameter String For example, HEAD~3. Default value is HEAD.
Name Type Description
Reset Output String Reset Output

Git - Set Remote Name

Adds or changes a remote name for the repository of the URL.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Name String The name of remote repository
* Url String The url of remote repository
* Working Folder String The working directory is the checkout location on your disk.
Default Branch String Specifies the default branch (For example, the target of the symbolic-ref refs/remotes/<name>/HEAD) for the named remote.
Timeout Duration long Time to wait for the action in seconds.
Track Branches String[] Specifies refspec to track only branches instead of the default glob refspec for the remote to track all branches under the refs/remotes/<name>/ namespace.

Git - Stash Command

Stashes the changes in a dirty working directory away.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Additional Arguments String The additional arguments of stash command. '--index' for 'pop' or 'apply' command; '-p', '-k', '-u' for 'save' command.
Branch String For sub-command branch only.
Message String Message for sub-command save, create, store.
Stash String Stash name for sub-command list, show, drop, pop, apply, branch.
Stash Command GitStashAction$SubCommand The sub-command of stash command.
Timeout Duration long Time to wait for the action in seconds.
Name Type Description
Output String The output of Git command.

Git - Status

Shows the working tree status.

Name Type Description
* Git Executable Path String The installation path of the Git command-line tool. For example: 'C:\Program Files\Git\bin\Git.exe'.
* Working Folder String The working directory is the checkout location on your disk.
Column Option GitStatusAction$ColumnOptions Option could be always|never. Default value is never.
Ignored File option Boolean Whether ignored files are shown.
Option GitStatusAction$Options Option could be short_format|branch_format|porcelain_format|long_format|NUL_format. Default value is long_format.
Submodules Option GitStatusAction$SubmodulesOptions Option could be none|untracked|dirty|all. Default value is all.
Timeout Duration long Time to wait for the action in seconds.
Untracked File Option GitStatusAction$UntrackedFilesOptions Option could be no|normal|all. Default value is all.
Name Type Description
Status Output String Status Output

Sample Git Workflow

The Git repository files and their contents can be in several states. Git commands operate on files and file contents in these three states and can bring files from one state into another.

  • Working Directory
    A file is stored in the working directory of the user but Git is unaware of this action.
  • Staging area
    The user has informed Git about a new file or new file content that will be stored into repository in the future. Files can be removed from the staging area. The staging area is also known as the index.
  • Repository
    A file and its content are stored in Git repository and ready for updates or retrieval.

The following sample workflows can be built in CA Release Automation using Git actions:

Initialization

  • Create Git repository, add Git user name and Git user mail address, add initial set of files and folders, then commit initial set of files and folders.

Recurring

  • Add modified files to Git staging area then (optionally) remove modified files from Git staging area
  • Add modified files to Git staging area, Commit modified files to repository, then (optionally) Undo Commit.
Was this helpful?

Please log in to post comments.