2017-09-28 23:31:50 +08:00
---
title: "SpaceVim git layer"
2021-06-21 20:39:29 +08:00
description: "This layer adds extensive support for git"
2017-09-28 23:31:50 +08:00
---
2018-06-23 14:37:41 +08:00
# [Available Layers](../) >> git
2017-09-28 23:31:50 +08:00
<!-- vim - markdown - toc GFM -->
- [Description ](#description )
- [Install ](#install )
2019-08-18 16:12:42 +08:00
- [Layer options ](#layer-options )
2017-09-28 23:31:50 +08:00
- [Key bindings ](#key-bindings )
<!-- vim - markdown - toc -->
## Description
2021-06-21 20:39:29 +08:00
This layer adds extensive support for [git ](https://git-scm.com/ ).
2017-09-28 23:31:50 +08:00
## Install
2021-06-21 20:39:29 +08:00
To use this configuration layer, add the following snippet to your custom configuration file (`SPC f v d`).
2017-09-28 23:31:50 +08:00
2018-05-27 13:05:57 +08:00
```toml
[[layers]]
name = "git"
```
2017-09-28 23:31:50 +08:00
2019-08-18 16:12:42 +08:00
## Layer options
2021-04-28 12:18:13 +08:00
- `git_plugin` : default value is `git` , available values include: [`gina` ](https://github.com/lambdalisue/gina.vim ), [`fugitive` ](https://github.com/tpope/vim-fugitive ), [`gita` ](https://github.com/lambdalisue/vim-gita ) (obsolete), `git` .
2021-04-11 14:13:57 +08:00
if you want to use `fugitive` instead:
```toml
[[layers]]
name = "git"
git_plugin = 'fugitive'
```
2019-08-18 16:12:42 +08:00
2017-09-28 23:31:50 +08:00
## Key bindings
2018-05-27 13:05:57 +08:00
| Key Binding | Description |
| ----------- | ---------------------- |
| `SPC g s` | view git status |
| `SPC g S` | stage current file |
| `SPC g U` | unstage current file |
| `SPC g c` | edit git commit |
| `SPC g p` | git push |
2020-05-25 23:42:26 +08:00
| `SPC g m` | git branch manager |
2018-05-27 13:05:57 +08:00
| `SPC g d` | view git diff |
| `SPC g A` | stage all files |
| `SPC g b` | open git blame windows |
2019-04-24 21:13:20 +08:00
| `SPC g h a` | stage current hunk |
| `SPC g h r` | undo cursor hunk |
| `SPC g h v` | preview cursor hunk |