|
| 1 | +<p align="center"> |
| 2 | + <a href="#gh-dark-mode-only" target="_blank" rel="noopener noreferrer"> |
| 3 | + <img src=".github/assets/night.svg" alt="git-extra-profiles.plugin.zsh"> |
| 4 | + </a> |
| 5 | + |
| 6 | + <a href="#gh-light-mode-only" target="_blank" rel="noopener noreferrer"> |
| 7 | + <img src=".github/assets/day.svg" alt="git-extra-profiles.plugin.zsh"> |
| 8 | + </a> |
| 9 | +</p> |
| 10 | + |
| 11 | +Plugin for managing multiple `git` profiles. |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +## Installation |
| 16 | + |
| 17 | +### Using [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) |
| 18 | + |
| 19 | +```sh |
| 20 | +git clone https://github.com/baliestri/git-profiles.plugin.zsh.git $ZSH_CUSTOM/plugins/git-profiles |
| 21 | +``` |
| 22 | + |
| 23 | +Then add `git-profiles` to the plugins array in your zshrc file: |
| 24 | + |
| 25 | +```sh |
| 26 | +plugins=(... git-profiles) |
| 27 | +``` |
| 28 | + |
| 29 | +### Using [zplug](https://github.com/zplug/zplug) |
| 30 | + |
| 31 | +```sh |
| 32 | +zplug "baliestri/git-profiles.plugin.zsh" |
| 33 | +``` |
| 34 | + |
| 35 | +### Using [zinit](https://github.com/zdharma-continuum/zinit) |
| 36 | + |
| 37 | +```sh |
| 38 | +zinit light baliestri/git-profiles.plugin.zsh |
| 39 | +``` |
| 40 | + |
| 41 | +### Using [zgenom](https://github.com/jandamm/zgenom) |
| 42 | + |
| 43 | +```sh |
| 44 | +zgenom load baliestri/git-profiles.plugin.zsh |
| 45 | +``` |
| 46 | + |
| 47 | +### Using [zi](https://github.com/z-shell/zi) |
| 48 | + |
| 49 | +```sh |
| 50 | +zi light baliestri/git-profiles.plugin.zsh |
| 51 | +``` |
| 52 | + |
| 53 | +## Usage |
| 54 | + |
| 55 | +### Define where your profiles are stored |
| 56 | + |
| 57 | +```sh |
| 58 | +# ~/.zshrc |
| 59 | + |
| 60 | +export GIT_PROFILES_FILE="$HOME/.config/git/profiles" # Fallback to $HOME/.git-profiles |
| 61 | +``` |
| 62 | + |
| 63 | +### Add a new profile |
| 64 | + |
| 65 | +```sh |
| 66 | +# ~/.config/git/profiles |
| 67 | + |
| 68 | +[profile "default"] |
| 69 | + name = Bruno Sales |
| 70 | + email = me@baliestri.dev |
| 71 | + # signingkey = 1234567890 |
| 72 | + |
| 73 | +[profile "work"] |
| 74 | + name = Bruno Sales |
| 75 | + email = work@baliestri.dev |
| 76 | + # signingkey = 1234567890 |
| 77 | + path = "/home/baliestri/work" |
| 78 | +``` |
0 commit comments