# devices.git:gitDevice


Interface to Git repositories.


Usage

``` python
devices.git:gitDevice(repo_path)
```


A class that provides methods to interact with a Git repository using the pygit2 library.


## Parameters


`repo_path: str`  
Path to the Git repository.


## Attributes


`repo_path: str`  
Path to the Git repository.

`repo: pygit2.Repository`  
The pygit2 Repository object.

`config_params: dict`  
Dictionary mapping parameter names to method names.


## Methods

| Name | Description |
|----|----|
| [__init__()](#__init__) | Initialize a gitDevice with the specified repository path. |
| [get_branch_name()](#get_branch_name) | Get the name of the current branch. |
| [get_commit_hash()](#get_commit_hash) | Get the hash of the current HEAD commit. |
| [get_diff()](#get_diff) | Get a text representation of the current diff. |
| [get_remote_url()](#get_remote_url) | Get the URL of the first remote. |
| [get_status()](#get_status) | Get the status of the repository. |

------------------------------------------------------------------------


### \_\_init\_\_()


Initialize a gitDevice with the specified repository path.


Usage

``` python
__init__(repo_path)
```


#### Parameters


`repo_path: str`  
Path to the Git repository.


#### Raises


`Exception`  
If the repository cannot be opened.


------------------------------------------------------------------------


### get_branch_name()


Get the name of the current branch.


Usage

``` python
get_branch_name()
```


#### Returns


`str`  
The name of the current branch.


------------------------------------------------------------------------


### get_commit_hash()


Get the hash of the current HEAD commit.


Usage

``` python
get_commit_hash()
```


#### Returns


`str`  
The hash of the current HEAD commit.


------------------------------------------------------------------------


### get_diff()


Get a text representation of the current diff.


Usage

``` python
get_diff()
```


#### Returns


`str`  
A text representation of the changes in the repository.


------------------------------------------------------------------------


### get_remote_url()


Get the URL of the first remote.


Usage

``` python
get_remote_url()
```


#### Returns


`str or None`  
The URL of the first remote, or None if no remotes are configured.


------------------------------------------------------------------------


### get_status()


Get the status of the repository.


Usage

``` python
get_status()
```


#### Returns


`dict`  
A dictionary with keys representing different status categories (staged, modified, untracked, etc.) and values as lists of file paths.
