# eric7.Plugins.VcsPlugins.vcsGit.git

Module implementing the version control systems interface to Git.

### Global Attributes

None

### Classes

Git | Class implementing the version control systems interface to Git.

### Functions

None

## Git

Class implementing the version control systems interface to Git.

### Signals

committed()
  emitted after the commit action has completed

### Derived from

VersionControl

### Class Attributes

IgnoreFileName

### Class Methods

None

### Methods

Git | Constructor
__gitGetFileForRevision | Private method to get a file for a specific revision from the repository.
__gitGetStashesList | Private method to get a list of stash names.
__gitSubmodulesList | Private method to get the data of defined submodules.
__selectSubmodulePath | Private method to select a submodule path.
__selectSubmodulePaths | Private method to select a list of submodule paths.
__vcsCommit_Step2 | Private slot performing the second step of the commit action.
_createStatusMonitorThread | Protected method to create an instance of the VCS status monitor thread.
clearStatusCache | Public method to clear the status cache.
getPlugin | Public method to get a reference to the plugin object.
gitAddRemote | Public method to add a remote repository.
gitApply | Public method to apply a patch stored in a given file.
gitApplyCheckPatches | Public method to apply a list of patch files or check, if they would apply cleanly.
gitBisect | Public method to perform bisect commands.
gitBisectCreateReplayFile | Public method used to create a bisect replay file for the project.
gitBisectEditReplayFile | Public method used to edit a bisect replay file.
gitBisectLogBrowser | Public method used to browse the bisect log of the project.
gitBisectReplay | Public method to replay a bisect session.
gitBlame | Public method to show the output of the git blame command.
gitBranch | Public method used to create, delete or move a branch in the Git repository.
gitBundle | Public method to create a bundle file.
gitBundleFetch | Public method to fetch a head of a bundle file into the local repository.
gitBundleListHeads | Public method to list the heads contained in a bundle file.
gitBundlePull | Public method to pull a head of a bundle file into the local repository and working area.
gitCancelMerge | Public method to cancel an uncommitted or failed merge.
gitChangeRemoteCredentials | Public method to change the user credentials of a remote repository.
gitChangeRemoteUrl | Public method to change the URL of a remote repository.
gitCherryPick | Public method to cherry pick commits and apply them to the current branch.
gitCherryPickAbort | Public method to cancel the last copying session and return to the previous state.
gitCherryPickContinue | Public method to continue the last copying session after conflicts were resolved.
gitCherryPickQuit | Public method to quit the current copying operation.
gitCommitMerge | Public method to commit a failed merge.
gitCopy | Public method used to copy a file/directory.
gitCreateArchive | Public method to show some statistics of the local repository.
gitCreateIgnoreFile | Public method to create the ignore file.
gitDeleteRemoteBranch | Public method to delete a branch from a remote repository.
gitDescribe | Public method to find the most recent tag reachable from each commit.
gitEditConfig | Public method used to edit the repository configuration file.
gitEditUserConfig | Public method used to edit the user configuration file.
gitExtendedDiff | Public method used to view the difference of a file/directory to the Git repository.
gitFetch | Public method to fetch changes from a remote repository.
gitGetArchiveFormats | Public method to get a list of supported archive formats.
gitGetBranchesList | Public method to get the list of branches.
gitGetBundleHeads | Public method to get a list of heads contained in a bundle file.
gitGetCurrentBranch | Public method used to show the current branch of the working directory.
gitGetRemoteBranchesList | Public method to get the list of a remote repository branches.
gitGetRemoteUrl | Public method to get the URL of a remote repository.
gitGetRemoteUrlsList | Public method to get the list of remote repos and their URLs.
gitGetRemotesList | Public method to get the list of remote repos.
gitGetTagsList | Public method to get the list of tags.
gitHouseKeeping | Public method to cleanup and optimize the local repository.
gitListTagBranch | Public method used to list the available tags or branches.
gitNormalizeURL | Public method to normalize a url for Git.
gitPruneRemote | Public method to prune stale remote-tracking branches.
gitPull | Public method used to pull changes from a remote Git repository.
gitPush | Public method used to push changes to a remote Git repository.
gitReflogBrowser | Public method used to browse the reflog of the project.
gitRemoveRemote | Public method to remove a remote repository.
gitRenameRemote | Public method to rename a remote repository.
gitShortlog | Public method to show a short log suitable for inclusion in release announcements.
gitShowBranch | Public method used to show the current branch of the working directory.
gitShowConfig | Public method to show the combined configuration.
gitShowPatchesStatistics | Public method to show statistics for a set of patch files.
gitShowRemote | Public method to show information about a remote repository.
gitShowRemotes | Public method to show available remote repositories.
gitStashApply | Public method to apply a stash but keep it.
gitStashBranch | Public method to create a branch from a stash.
gitStashBrowser | Public method used to browse the stashed changes.
gitStashClear | Public method to delete all stashes.
gitStashDrop | Public method to delete a stash.
gitStashPop | Public method to apply a stash and delete it.
gitStashSave | Public method to save the current changes to a new stash.
gitStashShowPatch | Public method to show the contents of a stash.
gitStatistics | Public method to show some statistics of the local repository.
gitSubmoduleAdd | Public method to add a submodule to the project.
gitSubmoduleDeinit | Public method to unregister submodules.
gitSubmoduleInit | Public method to initialize one or all submodules.
gitSubmoduleList | Public method to show a list of all submodules of the project.
gitSubmoduleStatus | Public method to show the status of the submodules.
gitSubmoduleSummary | Public method to show the status of the submodules.
gitSubmoduleSync | Public method to synchronize submodules.
gitSubmoduleUpdate | Public method to update submodules.
gitSubmoduleUpdateWithOptions | Public method to update submodules offering a dialog to select the update options.
gitUnstage | Public method used to unstage a file/directory.
gitVerify | Public method to verify the connectivity and validity of objects of the database.
gitVerifyBundle | Public method to verify a bundle file.
initCommand | Public method to initialize a command arguments list.
vcsAdd | Public method used to add a file/directory to the Git repository.
vcsAddBinary | Public method used to add a file/directory in binary mode to the Git repository.
vcsAddCommitMessage | Public method to add a commit message to the list of saved messages.
vcsAddTree | Public method to add a directory tree rooted at path to the Git repository.
vcsAllRegisteredStates | Public method used to get the registered states of a number of files in the vcs.
vcsCheckout | Public method used to check the project out of a Git repository (clone).
vcsCleanup | Public method used to cleanup the working directory.
vcsClearCommitMessages | Public method to clear the list of saved messages.
vcsCommandLine | Public method used to execute arbitrary Git commands.
vcsCommit | Public method used to make the change of a file/directory permanent in the Git repository.
vcsCommitMessages | Public method to get the list of saved commit messages.
vcsConvertProject | Public method to convert an uncontrolled project to a version controlled project.
vcsDiff | Public method used to view the difference of a file/directory to the Git repository.
vcsExists | Public method used to test for the presence of the git executable.
vcsExport | Public method used to export a directory from the Git repository.
vcsForget | Public method used to remove a file from the Mercurial repository.
vcsGetProjectBrowserHelper | Public method to instantiate a helper object for the different project browsers.
vcsGetProjectHelper | Public method to instantiate a helper object for the project.
vcsImport | Public method used to import the project into the Git repository.
vcsInit | Public method used to initialize the Git repository.
vcsInitConfig | Public method to initialize the VCS configuration.
vcsLogBrowser | Public method used to browse the log of a file/directory from the Git repository.
vcsMerge | Public method used to merge a URL/revision into the local project.
vcsMove | Public method used to move a file/directory.
vcsName | Public method returning the name of the vcs.
vcsNewProjectOptionsDialog | Public method to get a dialog to enter repository info for getting a new project.
vcsOptionsDialog | Public method to get a dialog to enter repository info.
vcsRegisteredState | Public method used to get the registered state of a file in the vcs.
vcsRemove | Public method used to remove a file/directory from the Git repository.
vcsRepositoryInfos | Public method to retrieve information about the repository.
vcsRevert | Public method used to revert changes made to a file/directory.
vcsSbsDiff | Public method used to view the difference of a file to the Git repository side-by-side.
vcsShutdown | Public method used to shutdown the Git interface.
vcsStatus | Public method used to view the status of files/directories in the Git repository.
vcsSupportCommandOptions | Public method to signal the support of user settable command options.
vcsSwitch | Public method used to switch a working directory to a different revision.
vcsTag | Public method used to set/remove a tag in the Git repository.
vcsUpdate | Public method used to update a file/directory with the Git repository.

### Static Methods

None

#### Git (Constructor)

Git(plugin, parent=None, name=None)

Constructor

plugin
  reference to the plugin object
parent
  parent widget (QWidget)
name
  name of this object (string)

#### Git.__gitGetFileForRevision

__gitGetFileForRevision(name, rev="")

Private method to get a file for a specific revision from the repository.

name
  file name to get from the repository (string)
rev
  revision to retrieve (string)

Return:
  contents of the file (string) and an error message (string)

#### Git.__gitGetStashesList

__gitGetStashesList(projectDir)

Private method to get a list of stash names.

projectDir
  name of the project directory (string)

Return:
  list of available stashes (list of string)

#### Git.__gitSubmodulesList

__gitSubmodulesList(repodir)

Private method to get the data of defined submodules.

repodir (str)
  name of the directory containing the repo subdirectory

Return:
  list of dictionaries with submodule name, path, URL and branch

Return Type:
  list of dict

#### Git.__selectSubmodulePath

__selectSubmodulePath(repodir)

Private method to select a submodule path.

repodir (str)
  name of the directory containing the repo subdirectory

Return:
  tuple of selected submodule path and flag indicating a cancellation

Return Type:
  tuple of (str, bool)

#### Git.__selectSubmodulePaths

__selectSubmodulePaths(repodir)

Private method to select a list of submodule paths.

repodir (str)
  name of the directory containing the repo subdirectory

Return:
  tuple of selected submodule paths and flag indicating a cancellation

Return Type:
  tuple of (list of str, bool)

#### Git.__vcsCommit_Step2

__vcsCommit_Step2()

Private slot performing the second step of the commit action.

#### Git._createStatusMonitorThread

_createStatusMonitorThread(interval, project)

Protected method to create an instance of the VCS status monitor thread.

interval
  check interval for the monitor thread in seconds (integer)
project
  reference to the project object (Project)

Return:
  reference to the monitor thread (QThread)

#### Git.clearStatusCache

clearStatusCache()

Public method to clear the status cache.

#### Git.getPlugin

getPlugin()

Public method to get a reference to the plugin object.

Return:
  reference to the plugin object (VcsGitPlugin)

#### Git.gitAddRemote

gitAddRemote(projectDir)

Public method to add a remote repository.

projectDir
  name of the project directory (string)

#### Git.gitApply

gitApply(repodir, patchFile, cached=False, reverse=False, noDialog=False)

Public method to apply a patch stored in a given file.

repodir
  directory name of the repository (string)
patchFile
  name of the patch file (string)
cached
  flag indicating to apply the patch to the staging area (boolean)
reverse
  flag indicating to apply the patch in reverse (boolean)
noDialog
  flag indicating quiet operations (boolean)

#### Git.gitApplyCheckPatches

gitApplyCheckPatches(projectDir, check=False)

Public method to apply a list of patch files or check, if they would apply cleanly.

projectDir
  directory name of the project (string)
check
  flag indicating to perform a check operation (boolean)

#### Git.gitBisect

gitBisect(projectDir, subcommand)

Public method to perform bisect commands.

projectDir
  name of the project directory (string)
subcommand
  name of the subcommand (string, one of 'start', 'start_extended', 'good', 'bad', 'skip' or 'reset')

Return:
  flag indicating, that the update contained an add or delete (boolean)

Raises ValueError:
  raised to indicate an invalid bisect subcommand

#### Git.gitBisectCreateReplayFile

gitBisectCreateReplayFile(projectDir)

Public method used to create a bisect replay file for the project.

projectDir
  name of the project directory (string)

#### Git.gitBisectEditReplayFile

gitBisectEditReplayFile(projectDir)

Public method used to edit a bisect replay file.

projectDir
  name of the project directory (string)

#### Git.gitBisectLogBrowser

gitBisectLogBrowser(projectDir)

Public method used to browse the bisect log of the project.

projectDir
  name of the project directory (string)

#### Git.gitBisectReplay

gitBisectReplay(projectDir)

Public method to replay a bisect session.

projectDir
  name of the project directory (string)

Return:
  flag indicating, that the update contained an add or delete (boolean)

#### Git.gitBlame

gitBlame(name)

Public method to show the output of the git blame command.

name
  file name to show the annotations for (string)

#### Git.gitBranch

gitBranch(name, revision=None, branchName=None, branchOp=None)

Public method used to create, delete or move a branch in the Git repository.

name
  file/directory name to be branched (string)
revision
  revision to set tag for (string)
branchName
  name of the branch (string)
branchOp
  desired branch operation (integer)

Return:
  flag indicating a performed branch action (boolean) and a flag indicating, that the branch operation contained an add or delete (boolean)

#### Git.gitBundle

gitBundle(projectDir)

Public method to create a bundle file.

projectDir
  name of the project directory (string)

#### Git.gitBundleFetch

gitBundleFetch(projectDir)

Public method to fetch a head of a bundle file into the local repository.

projectDir
  name of the project directory (string)

#### Git.gitBundleListHeads

gitBundleListHeads(projectDir)

Public method to list the heads contained in a bundle file.

projectDir
  name of the project directory (string)

#### Git.gitBundlePull

gitBundlePull(projectDir)

Public method to pull a head of a bundle file into the local repository and working area.

projectDir
  name of the project directory (string)

Return:
  flag indicating, that the update contained an add or delete (boolean)

#### Git.gitCancelMerge

gitCancelMerge(name)

Public method to cancel an uncommitted or failed merge.

name
  file/directory name (string)

Return:
  flag indicating, that the cancellation contained an add or delete (boolean)

#### Git.gitChangeRemoteCredentials

gitChangeRemoteCredentials(projectDir, remoteName, remoteUrl="")

Public method to change the user credentials of a remote repository.

projectDir (str)
  name of the project directory
remoteName (str)
  name of the remote repository
remoteUrl (str)
  URL of the remote repository

#### Git.gitChangeRemoteUrl

gitChangeRemoteUrl(projectDir, remoteName, remoteUrl="")

Public method to change the URL of a remote repository.

projectDir (str)
  name of the project directory
remoteName (str)
  name of the remote repository
remoteUrl (str)
  URL of the remote repository

#### Git.gitCherryPick

gitCherryPick(projectDir, commits=None)

Public method to cherry pick commits and apply them to the current branch.

projectDir
  name of the project directory (string)
commits
  list of commits to be applied (list of strings)

Return:
  flag indicating that the project should be reread (boolean)

#### Git.gitCherryPickAbort

gitCherryPickAbort(projectDir)

Public method to cancel the last copying session and return to the previous state.

projectDir
  name of the project directory (string)

Return:
  flag indicating that the project should be reread (boolean)

#### Git.gitCherryPickContinue

gitCherryPickContinue(projectDir)

Public method to continue the last copying session after conflicts were resolved.

projectDir
  name of the project directory (string)

Return:
  flag indicating that the project should be reread (boolean)

#### Git.gitCherryPickQuit

gitCherryPickQuit(projectDir)

Public method to quit the current copying operation.

projectDir
  name of the project directory (string)

Return:
  flag indicating that the project should be reread (boolean)

#### Git.gitCommitMerge

gitCommitMerge(name)

Public method to commit a failed merge.

name
  file/directory name (string)

#### Git.gitCopy

gitCopy(name, project)

Public method used to copy a file/directory.

name
  file/directory name to be copied (string)
project
  reference to the project object

Return:
  flag indicating successful operation (boolean)

#### Git.gitCreateArchive

gitCreateArchive(projectDir)

Public method to show some statistics of the local repository.

projectDir
  name of the project directory (string)

#### Git.gitCreateIgnoreFile

gitCreateIgnoreFile(name, autoAdd=False)

Public method to create the ignore file.

name
  directory name to create the ignore file in (string)
autoAdd
  flag indicating to add it automatically (boolean)

Return:
  flag indicating success

#### Git.gitDeleteRemoteBranch

gitDeleteRemoteBranch(name)

Public method to delete a branch from a remote repository.

name
  file/directory name (string)

#### Git.gitDescribe

gitDescribe(projectDir, commits)

Public method to find the most recent tag reachable from each commit.

projectDir
  name of the project directory (string)
commits
  list of commits to start the search from (list of strings)

#### Git.gitEditConfig

gitEditConfig(projectDir)

Public method used to edit the repository configuration file.

projectDir
  name of the project directory (string)

#### Git.gitEditUserConfig

gitEditUserConfig()

Public method used to edit the user configuration file.

#### Git.gitExtendedDiff

gitExtendedDiff(name)

Public method used to view the difference of a file/directory to the Git repository.

If name is a directory and is the project directory, all project files are saved first. If name is a file (or list of files), which is/are being edited and has unsaved modification, they can be saved or the operation may be aborted.

This method gives the chance to enter the revisions to be compared.

name
  file/directory name to be diffed (string)

#### Git.gitFetch

gitFetch(name)

Public method to fetch changes from a remote repository.

name
  directory name (string)

#### Git.gitGetArchiveFormats

gitGetArchiveFormats(repodir)

Public method to get a list of supported archive formats.

repodir
  directory name of the repository (string)

Return:
  list of supported archive formats (list of strings)

#### Git.gitGetBranchesList

gitGetBranchesList(repodir, withMaster=False, allBranches=False, remotes=False)

Public method to get the list of branches.

repodir
  directory name of the repository (string)
withMaster
  flag indicating to get 'master' as well (boolean)
allBranches
  flag indicating to return all branches (boolean)
remotes
  flag indicating to return remote branches only (boolean)

Return:
  list of branches (list of string)

#### Git.gitGetBundleHeads

gitGetBundleHeads(repodir, bundleFile)

Public method to get a list of heads contained in a bundle file.

repodir
  directory name of the repository (string)
bundleFile
  file name of a git bundle file (string)

Return:
  list of heads (list of strings)

#### Git.gitGetCurrentBranch

gitGetCurrentBranch(repodir)

Public method used to show the current branch of the working directory.

repodir
  directory name of the repository (string)

Return:
  name of the current branch (string)

#### Git.gitGetRemoteBranchesList

gitGetRemoteBranchesList(repodir, remote)

Public method to get the list of a remote repository branches.

repodir
  directory name of the repository (string)
remote
  remote repository name (string)

Return:
  list of remote repository branches (list of string)

#### Git.gitGetRemoteUrl

gitGetRemoteUrl(repodir, remoteName)

Public method to get the URL of a remote repository.

repodir (str)
  directory name of the repository
remoteName (str)
  name of the remote repository

Return:
  URL of the remote repository

Return Type:
  str

#### Git.gitGetRemoteUrlsList

gitGetRemoteUrlsList(repodir, forFetch=True)

Public method to get the list of remote repos and their URLs.

repodir
  directory name of the repository (string)
forFetch
  flag indicating to get Fetch info (string)

Return:
  list of tuples of remote repo name and repo URL (list of tuple of two strings)

#### Git.gitGetRemotesList

gitGetRemotesList(repodir)

Public method to get the list of remote repos.

repodir
  directory name of the repository (string)

Return:
  list of remote repos (list of string)

#### Git.gitGetTagsList

gitGetTagsList(repodir, withType=False)

Public method to get the list of tags.

repodir
  directory name of the repository (string)
withType
  flag indicating to get the tag type as well (boolean)

Return:
  list of tags (list of string) or list of tuples of tag name and flag indicating a local tag (list of tuple of string and boolean), if withType is True

#### Git.gitHouseKeeping

gitHouseKeeping(projectDir)

Public method to cleanup and optimize the local repository.

projectDir
  name of the project directory (string)

#### Git.gitListTagBranch

gitListTagBranch(path, tags=True, listAll=True, merged=True)

Public method used to list the available tags or branches.

path
  directory name of the project (string)
tags
  flag indicating listing of branches or tags (False = branches, True = tags)
listAll
  flag indicating to show all tags or branches (boolean)
merged
  flag indicating to show only merged or non-merged branches (boolean)

#### Git.gitNormalizeURL

gitNormalizeURL(url)

Public method to normalize a url for Git.

url
  url string (string)

Return:
  properly normalized url for git (string)

#### Git.gitPruneRemote

gitPruneRemote(projectDir, remoteName)

Public method to prune stale remote-tracking branches.

projectDir
  name of the project directory (string)
remoteName
  name of the remote repository (string)

#### Git.gitPull

gitPull(name)

Public method used to pull changes from a remote Git repository.

name
  directory name of the project to be pulled to (string)

Return:
  flag indicating, that the update contained an add or delete (boolean)

#### Git.gitPush

gitPush(name)

Public method used to push changes to a remote Git repository.

name
  directory name of the project to be pushed from (string)

#### Git.gitReflogBrowser

gitReflogBrowser(projectDir)

Public method used to browse the reflog of the project.

projectDir
  name of the project directory (string)

#### Git.gitRemoveRemote

gitRemoveRemote(projectDir, remoteName)

Public method to remove a remote repository.

projectDir
  name of the project directory (string)
remoteName
  name of the remote repository (string)

#### Git.gitRenameRemote

gitRenameRemote(projectDir, remoteName)

Public method to rename a remote repository.

projectDir
  name of the project directory (string)
remoteName
  name of the remote repository (string)

#### Git.gitShortlog

gitShortlog(projectDir, commit)

Public method to show a short log suitable for inclusion in release announcements.

projectDir
  name of the project directory (string)
commit
  commit to start the log at (strings)

#### Git.gitShowBranch

gitShowBranch(name)

Public method used to show the current branch of the working directory.

name
  file/directory name (string)

#### Git.gitShowConfig

gitShowConfig(projectDir)

Public method to show the combined configuration.

projectDir
  name of the project directory (string)

#### Git.gitShowPatchesStatistics

gitShowPatchesStatistics(projectDir)

Public method to show statistics for a set of patch files.

projectDir
  directory name of the project (string)

#### Git.gitShowRemote

gitShowRemote(projectDir, remoteName)

Public method to show information about a remote repository.

projectDir
  name of the project directory (string)
remoteName
  name of the remote repository (string)

#### Git.gitShowRemotes

gitShowRemotes(projectDir)

Public method to show available remote repositories.

projectDir
  name of the project directory (string)

#### Git.gitStashApply

gitStashApply(projectDir, stashName="")

Public method to apply a stash but keep it.

projectDir
  name of the project directory (string)
stashName
  name of a stash (string)

Return:
  flag indicating, that the restore contained an add or delete (boolean)

#### Git.gitStashBranch

gitStashBranch(projectDir, stashName="")

Public method to create a branch from a stash.

projectDir
  name of the project directory (string)
stashName
  name of a stash (string)

Return:
  flag indicating, that the restore contained an add or delete (boolean)

#### Git.gitStashBrowser

gitStashBrowser(projectDir)

Public method used to browse the stashed changes.

projectDir
  name of the project directory (string)

#### Git.gitStashClear

gitStashClear(projectDir)

Public method to delete all stashes.

projectDir
  name of the project directory (string)

Return:
  flag indicating a successful deletion (boolean)

#### Git.gitStashDrop

gitStashDrop(projectDir, stashName="")

Public method to delete a stash.

projectDir
  name of the project directory (string)
stashName
  name of a stash (string)

Return:
  flag indicating a successful deletion (boolean)

#### Git.gitStashPop

gitStashPop(projectDir, stashName="")

Public method to apply a stash and delete it.

projectDir
  name of the project directory (string)
stashName
  name of a stash (string)

Return:
  flag indicating, that the restore contained an add or delete (boolean)

#### Git.gitStashSave

gitStashSave(projectDir)

Public method to save the current changes to a new stash.

projectDir
  name of the project directory (string)

Return:
  flag indicating, that the save contained an add or delete (boolean)

#### Git.gitStashShowPatch

gitStashShowPatch(projectDir, stashName="")

Public method to show the contents of a stash.

projectDir
  name of the project directory (string)
stashName
  name of a stash (string)

#### Git.gitStatistics

gitStatistics(projectDir)

Public method to show some statistics of the local repository.

projectDir
  name of the project directory (string)

#### Git.gitSubmoduleAdd

gitSubmoduleAdd(projectDir)

Public method to add a submodule to the project.

projectDir (str)
  name of the project directory

#### Git.gitSubmoduleDeinit

gitSubmoduleDeinit(projectDir)

Public method to unregister submodules.

projectDir (str)
  name of the project directory

#### Git.gitSubmoduleInit

gitSubmoduleInit(projectDir)

Public method to initialize one or all submodules.

projectDir (str)
  name of the project directory

#### Git.gitSubmoduleList

gitSubmoduleList(projectDir)

Public method to show a list of all submodules of the project.

projectDir (str)
  name of the project directory

#### Git.gitSubmoduleStatus

gitSubmoduleStatus(projectDir)

Public method to show the status of the submodules.

projectDir (str)
  name of the project directory

#### Git.gitSubmoduleSummary

gitSubmoduleSummary(projectDir)

Public method to show the status of the submodules.

projectDir (str)
  name of the project directory

#### Git.gitSubmoduleSync

gitSubmoduleSync(projectDir)

Public method to synchronize submodules.

projectDir (str)
  name of the project directory

#### Git.gitSubmoduleUpdate

gitSubmoduleUpdate(projectDir, initialize=False, remote=False)

Public method to update submodules.

projectDir (str)
  name of the project directory
initialize (bool)
  flag indicating an initialize and update operation
remote (bool)
  flag indicating a fetch and update operation

#### Git.gitSubmoduleUpdateWithOptions

gitSubmoduleUpdateWithOptions(projectDir)

Public method to update submodules offering a dialog to select the update options.

projectDir (str)
  name of the project directory

#### Git.gitUnstage

gitUnstage(name)

Public method used to unstage a file/directory.

name
  file/directory name to be reverted (string)

Return:
  flag indicating, that the update contained an add or delete (boolean)

#### Git.gitVerify

gitVerify(projectDir)

Public method to verify the connectivity and validity of objects of the database.

projectDir
  name of the project directory (string)

#### Git.gitVerifyBundle

gitVerifyBundle(projectDir)

Public method to verify a bundle file.

projectDir
  name of the project directory (string)

#### Git.initCommand

initCommand(command)

Public method to initialize a command arguments list.

command
  command name (string)

Return:
  list of command options (list of string)

#### Git.vcsAdd

vcsAdd(name, isDir=False, noDialog=False)

Public method used to add a file/directory to the Git repository.

name
  file/directory name to be added (string)
isDir
  flag indicating name is a directory (boolean)
noDialog
  flag indicating quiet operations

#### Git.vcsAddBinary

vcsAddBinary(name, isDir=False)

Public method used to add a file/directory in binary mode to the Git repository.

name
  file/directory name to be added (string)
isDir
  flag indicating name is a directory (boolean)

#### Git.vcsAddCommitMessage

vcsAddCommitMessage(message)

Public method to add a commit message to the list of saved messages.

message (str)
  message to be added

#### Git.vcsAddTree

vcsAddTree(path)

Public method to add a directory tree rooted at path to the Git repository.

path
  root directory of the tree to be added (string or list of strings))

#### Git.vcsAllRegisteredStates

vcsAllRegisteredStates(names, dname, shortcut=True)

Public method used to get the registered states of a number of files in the vcs.

Note: If a shortcut is to be taken, the code will only check, if the named directory has been scanned already. If so, it is assumed, that the states for all files have been populated by the previous run.

names
  dictionary with all filenames to be checked as keys
dname
  directory to check in (string)
shortcut
  flag indicating a shortcut should be taken (boolean)

Return:
  the received dictionary completed with a combination of canBeCommited and canBeAdded or None in order to signal an error

#### Git.vcsCheckout

vcsCheckout(vcsDataDict, projectDir, noDialog=False)

Public method used to check the project out of a Git repository (clone).

vcsDataDict
  dictionary of data required for the checkout
projectDir
  project directory to create (string)
noDialog
  flag indicating quiet operations

Return:
  flag indicating an execution without errors (boolean)

#### Git.vcsCleanup

vcsCleanup(name)

Public method used to cleanup the working directory.

name
  directory name to be cleaned up (string)

#### Git.vcsClearCommitMessages

vcsClearCommitMessages()

Public method to clear the list of saved messages.

#### Git.vcsCommandLine

vcsCommandLine(name)

Public method used to execute arbitrary Git commands.

name
  directory name of the working directory (string)

#### Git.vcsCommit

vcsCommit(name, message="", noDialog=False, commitAll=True, amend=False)

Public method used to make the change of a file/directory permanent in the Git repository.

name
  file/directory name to be committed (string or list of strings)
message
  message for this operation (string)
noDialog
  flag indicating quiet operations (boolean)
commitAll
  flag indicating to commit all local changes (boolean)
amend
  flag indicating to amend the HEAD commit (boolean)

#### Git.vcsCommitMessages

vcsCommitMessages()

Public method to get the list of saved commit messages.

Return:
  list of saved commit messages

Return Type:
  list of str

#### Git.vcsConvertProject

vcsConvertProject(vcsDataDict, project, addAll=True)

Public method to convert an uncontrolled project to a version controlled project.

vcsDataDict (dict)
  dictionary of data required for the conversion
project (Project)
  reference to the project object
addAll (bool)
  flag indicating to add all files to the repository

#### Git.vcsDiff

vcsDiff(name)

Public method used to view the difference of a file/directory to the Git repository.

If name is a directory and is the project directory, all project files are saved first. If name is a file (or list of files), which is/are being edited and has unsaved modification, they can be saved or the operation may be aborted.

name
  file/directory name to be diffed (string)

#### Git.vcsExists

vcsExists()

Public method used to test for the presence of the git executable.

Return:
  flag indicating the existance (boolean) and an error message (string)

#### Git.vcsExport

vcsExport(vcsDataDict, projectDir)

Public method used to export a directory from the Git repository.

vcsDataDict
  dictionary of data required for the checkout
projectDir
  project directory to create (string)

Return:
  flag indicating an execution without errors (boolean)

#### Git.vcsForget

vcsForget(name)

Public method used to remove a file from the Mercurial repository.

This will not remove the file from the project directory.

name (str or list of str)
  file/directory name to be removed

#### Git.vcsGetProjectBrowserHelper

vcsGetProjectBrowserHelper(browser, project, isTranslationsBrowser=False)

Public method to instantiate a helper object for the different project browsers.

browser
  reference to the project browser object
project
  reference to the project object
isTranslationsBrowser
  flag indicating, the helper is requested for the translations browser (this needs some special treatment)

Return:
  the project browser helper object

#### Git.vcsGetProjectHelper

vcsGetProjectHelper(project)

Public method to instantiate a helper object for the project.

project
  reference to the project object

Return:
  the project helper object

#### Git.vcsImport

vcsImport(vcsDataDict, projectDir, noDialog=False, addAll=True)

Public method used to import the project into the Git repository.

vcsDataDict (dict)
  dictionary of data required for the import
projectDir (str)
  project directory (string)
noDialog (bool)
  flag indicating quiet operations
addAll (bool)
  flag indicating to add all files to the repository

Return:
  tuple containing a flag indicating an execution without errors and a flag indicating the version controll status

Return Type:
  tuple of (bool, bool)

#### Git.vcsInit

vcsInit(vcsDir, noDialog=False)

Public method used to initialize the Git repository.

The initialization is done, when a project is converted into a Git controlled project. Therefore we always return TRUE without doing anything.

vcsDir
  name of the VCS directory (string)
noDialog
  flag indicating quiet operations (boolean)

Return:
  always TRUE

#### Git.vcsInitConfig

vcsInitConfig(project)

Public method to initialize the VCS configuration.

This method ensures, that an ignore file exists.

project
  reference to the project (Project)

#### Git.vcsLogBrowser

vcsLogBrowser(name, isFile=False)

Public method used to browse the log of a file/directory from the Git repository.

name
  file/directory name to show the log of (string)
isFile
  flag indicating log for a file is to be shown (boolean)

#### Git.vcsMerge

vcsMerge(name)

Public method used to merge a URL/revision into the local project.

name
  file/directory name to be merged (string)

#### Git.vcsMove

vcsMove(name, project, target=None, noDialog=False)

Public method used to move a file/directory.

name
  file/directory name to be moved (string)
project
  reference to the project object
target
  new name of the file/directory (string)
noDialog
  flag indicating quiet operations

Return:
  flag indicating successful operation (boolean)

#### Git.vcsName

vcsName()

Public method returning the name of the vcs.

Return:
  always 'Git' (string)

#### Git.vcsNewProjectOptionsDialog

vcsNewProjectOptionsDialog(parent=None)

Public method to get a dialog to enter repository info for getting a new project.

parent
  parent widget (QWidget)

Return:
  reference to the instantiated options dialog (GitNewProjectOptionsDialog)

#### Git.vcsOptionsDialog

vcsOptionsDialog(project, archive, editable=False, parent=None)

Public method to get a dialog to enter repository info.

project
  reference to the project object
archive
  name of the project in the repository (string)
editable
  flag indicating that the project name is editable (boolean)
parent
  parent widget (QWidget)

Return:
  reference to the instantiated options dialog (GitOptionsDialog)

#### Git.vcsRegisteredState

vcsRegisteredState(name)

Public method used to get the registered state of a file in the vcs.

name
  filename to check (string)

Return:
  a combination of canBeCommited and canBeAdded

#### Git.vcsRemove

vcsRemove(name, project=False, noDialog=False, stageOnly=False)

Public method used to remove a file/directory from the Git repository.

The default operation is to remove the local copy as well.

name
  file/directory name to be removed (string or list of strings))
project
  flag indicating deletion of a project tree (boolean) (not needed)
noDialog
  flag indicating quiet operations (boolean)
stageOnly
  flag indicating to just remove the file from the staging area (boolean)

Return:
  flag indicating successful operation (boolean)

#### Git.vcsRepositoryInfos

vcsRepositoryInfos(ppath)

Public method to retrieve information about the repository.

ppath
  local path to get the repository infos (string)

Return:
  string with ready formated info for display (string)

#### Git.vcsRevert

vcsRevert(name)

Public method used to revert changes made to a file/directory.

name (str)
  file/directory name to be reverted

Return:
  flag indicating, that the update contained an add or delete

Return Type:
  bool

#### Git.vcsSbsDiff

vcsSbsDiff(name, extended=False, revisions=None)

Public method used to view the difference of a file to the Git repository side-by-side.

name
  file name to be diffed (string)
extended
  flag indicating the extended variant (boolean)
revisions
  tuple of two revisions (tuple of strings)

Raises ValueError:
  raised to indicate an invalid name parameter

#### Git.vcsShutdown

vcsShutdown()

Public method used to shutdown the Git interface.

#### Git.vcsStatus

vcsStatus(name)

Public method used to view the status of files/directories in the Git repository.

name
  file/directory name(s) to show the status of (string or list of strings)

#### Git.vcsSupportCommandOptions

vcsSupportCommandOptions()

Public method to signal the support of user settable command options.

Return:
  flag indicating the support of user settable command options (boolean)

#### Git.vcsSwitch

vcsSwitch(name)

Public method used to switch a working directory to a different revision.

name
  directory name to be switched (string)

Return:
  flag indicating, that the switch contained an add or delete (boolean)

#### Git.vcsTag

vcsTag(name, revision=None, tagName=None)

Public method used to set/remove a tag in the Git repository.

name
  file/directory name to determine the repo root from (string)
revision
  revision to set tag for (string)
tagName
  name of the tag (string)

Return:
  flag indicating a performed tag action (boolean)

#### Git.vcsUpdate

vcsUpdate(name, noDialog=False, revision=None)

Public method used to update a file/directory with the Git repository.

name
  file/directory name to be updated (string or list of strings)
noDialog
  flag indicating quiet operations (boolean)
revision
  revision to update to (string)

Return:
  flag indicating, that the update contained an add or delete (boolean)

Up