From 8ad9b315a389c741d93aece3ed6eae6b6829f951 Mon Sep 17 00:00:00 2001 From: Duc Nguyen Date: Fri, 9 Oct 2020 17:35:13 +0700 Subject: [PATCH] Add git-lfs plugin (#9077) --- .github/CODEOWNERS | 1 + plugins/git-lfs/README.md | 24 ++++++++++++++++++++++++ plugins/git-lfs/git-lfs.plugin.zsh | 17 +++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 plugins/git-lfs/README.md create mode 100644 plugins/git-lfs/git-lfs.plugin.zsh diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index cba8e93af..c3990c4ee 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,4 @@ # Plugin owners plugins/gitfast/ @felipec plugins/sdk/ @rgoldberg +plugins/git-lfs/ @vietduc01100001 diff --git a/plugins/git-lfs/README.md b/plugins/git-lfs/README.md new file mode 100644 index 000000000..1222b2767 --- /dev/null +++ b/plugins/git-lfs/README.md @@ -0,0 +1,24 @@ +# git lfs plugin + +The git lfs plugin provides [aliases](#aliases) and [functions](#functions) for [git-lfs](https://github.com/git-lfs/git-lfs). + +To use it, add `git-lfs` to the plugins array in your zshrc file: + +```zsh +plugins=(... git-lfs) +``` + +## Aliases + +| Alias | Command | +| :------- | :---------------------------------- | +| `glfsi` | `git lfs install` | +| `glfst` | `git lfs track` | +| `glfsls` | `git lfs ls-files` | +| `glfsmi` | `git lfs migrate import --include=` | + +## Functions + +| Function | Command | +| :------- | :---------------------------------------------- | +| `gplfs` | `git lfs push origin "$(current_branch)" --all` | diff --git a/plugins/git-lfs/git-lfs.plugin.zsh b/plugins/git-lfs/git-lfs.plugin.zsh new file mode 100644 index 000000000..e7bb67603 --- /dev/null +++ b/plugins/git-lfs/git-lfs.plugin.zsh @@ -0,0 +1,17 @@ +# +# Aliases +# + +alias glfsi='git lfs install' +alias glfst='git lfs track' +alias glfsls='git lfs ls-files' +alias glfsmi='git lfs migrate import --include=' + +# +# Functions +# + +function gplfs() { + local b="$(git_current_branch)" + git lfs push origin "$b" --all +}