Method Git.try_git()
- Method
try_git
string|zerotry_git(stringgit_dir,stringcommand,string...args)- Description
Attempt to run a git command and get its output.
- Parameter
git_dir Directory containing the Git repository. May be
UNDEFINEDto specify the Git repository for the current directory.- Parameter
command Git subcommand to execute.
- Parameter
args Arguemnts for
command.- Returns
Returns the output on stdout from running the command on success, and
0(zero) on failure.- Note
This is a convenience function, and there is no way to get the specific cause for failures other than rerunning the command with e.g. git().
- See also