From 2f50679937a3cea8017e76c9ea406e3c618355e6 Mon Sep 17 00:00:00 2001 From: Dmitry Chepurovskiy Date: Thu, 4 Jul 2019 04:04:52 +0300 Subject: [PATCH] Updated documentation and added git-profile alias --- .goreleaser.yml | 6 ++++-- README.md | 30 +++++++++++++++--------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 3b1061c..53d6a3d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -44,9 +44,11 @@ brews: test: | system "#{bin}/git-profile-manager", "--version" install: | - bin.install "git-profile-manager" - system "#{bin}/git-profile-manager completion bash > bash_completion.bash" system "#{bin}/git-profile-manager completion zsh > zsh_completion.zsh" bash_completion.install "bash_completion.bash" zsh_completion.install "zsh_completion.zsh" + + ln_s "#{bin}/git-profile-manager", "#{bin}/git-profile", false + bin.install "git-profile-manager" + bin.install "git-profile" diff --git a/README.md b/README.md index b332d29..5325cce 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,13 @@ [![CircleCI](https://circleci.com/gh/Dm3Ch/git-profile-manager.svg?style=svg)](https://circleci.com/gh/Dm3Ch/git-profile-manager) [![Go Report Card](https://goreportcard.com/badge/github.com/Dm3Ch/git-profile)](https://goreportcard.com/report/github.com/Dm3Ch/git-profile-manager) -[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/dotzero/git-profile/blob/master/LICENSE) +[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Sm3Ch/git-profile-manager/blob/master/LICENSE) Git Profile allows to add and switch between multiple user profiles in your git repositories. +This tool is uses git config includes, so if you change profile you'll change all configs that includes this profile. +Also profiles could contain not only `user.name`, `user.email`, `user.signingkey`, but any git config key. + ## Installation If you are OSX user, you can use [Homebrew](http://brew.sh/): @@ -16,13 +19,13 @@ brew install dm3ch/tap/git-profile-manager ### Prebuilt binaries -Download the binary from the [releases](https://github.com/dotzero/git-profile/releases) page and place it in `$PATH` directory. +Download the binary from the [releases](https://github.com/dm3ch/git-profile-manager/releases) page and place it in `$PATH` directory. ### Building from source If your operating system does not have a binary release, but does run Go, you can build from source. -Make sure that you have Go version 1.11 or greater and that your `GOPATH` env variable is set (I recommend setting it to `~/go` if you don't have one). +Make sure that you have Go version 1.12 or greater and that your `GOPATH` env variable is set (I recommend setting it to `~/go` if you don't have one). ```bash go get -u github.com/dm3ch/git-profile-manager @@ -35,26 +38,23 @@ The binary will then be installed to `$GOPATH/bin` (or your `$GOBIN`). Add an entry to a profile ```bash -git profile add home user.name dotzero -git profile add home user.email "mail@dotzero.ru" -git profile add home user.signingkey AAAAAAAA +$git profile-manager add test-profile  1|0 ↵  03:30:56 +Name: Test Name +Email: test@email.com +Signing Key: +Profile test-profile added successfully ``` -List of available profiles +List of available profiles: ```bash -git profile list +git profile-manager list ``` -Apply the profile to current git repository +Apply the profile to current git repository: ```bash -git profile use home - -# Under the hood it runs following commands: -# git git config --local user.name dotzero -# git git config --local user.email "mail@dotzero.ru" -# git git config --local user.signingkey AAAAAAAA +git profile-manager use home ``` ## License