zeeshan/git-profile 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zeeshan/git-profile

Composer 安装命令:

composer require zeeshan/git-profile

包简介

Change git profile on the go

关键字:

README 文档

README

git-profile

Utility that helps you switch git configurations with ease

Build Status Latest Version Software License

Preface

It is possible that you have multiple git configurations. For example:

; Office Profile
Name: John Doe
Email: johndoe@office.com

; Personal Profile
Name: John Doe
Email: johndoe@gmail.com

It could be a hassle to remember and switch between the profiles while working on different projects.

This utility aims to make this hassle free.

Features

  • Create and manage profiles globally; create once, use anywhere
  • Set profile for a specific project
  • Set global profile with a single command

This utility helps you save profiles and then you can switch between them using a single command.

Install

$ composer global require zeeshan/git-profile

Then check your $PATH variable. It must contain ~/.composer/vendor/bin dir.

$ echo $PATH

/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/home/username/.composer/vendor/bin

Modify your .zshrc or .bashrc files if your $PATH variable not contain composer/bin dir.

export PATH=~/.composer/vendor/bin:$PATH

Also you can use .phar file

  • Download the file from here
  • sudo chmod -R 755 git-profile
  • sudo mv git-profile /usr/local/bin/git-profile

Usage

$ git-profile [options] <command>

Options

-h, --help              Display this help message
-V, --version           Display this application version
--ansi                  Force ANSI output
--no-ansi               Disable ANSI output

Commands

rm                      Remove git profile
use                     Change git profile locally or globally
add                     Create a new git profile
show                    Show details for an existing profile
update                  Update details for an existing profile
current                 Gets the currently set profile
list                    List of profiles

Examples

Find some of the sample usages below

Adding Profiles

$ git-profile add

[+] Enter profile title: Office

[+] Enter Name: John Doe
[+] Enter Email: johndoe@office.com
[+] Enter Signingkey: B7156A83

[OK] Profile "Office" saved successfully

Remove Git Profile

$ git-profile rm "Office"

[OK] Profile "Office" successfully removed

Show Details for a profile

$ git-profile show "Office"

[+] Name:  John Doe
[+] Email: johndoe@office.com
[+] Signingkey: B7156A83

Updating Profile

$ git-profile update "Office"

[+] Enter Name: Jane Doe
[+] Enter Email: janedoe@gmail.com
[+] Enter Signingkey: 547ABB1C

[OK] Profile "Office" updated successfully

Switching Profile

Setting details locally i.e. set profile for the current project

$ git-profile use "Office"

[OK] Switched to "Office"

Setting details globally i.e. set global configuration

$ git-profile use "Office" --global

[OK] Switched to "Office"

Get Current Profile

$ git-profile current

[+] Current Profile "Office"
[+] Name: John Doe
[+] Email: johndoe@gmail.com
[+] Signingkey: 547ABB1C

Side note It should be noted that profiles are maintained globally. When you use some profile locally, what it does is get the configuration for that profile and sets it for the current project. i.e. when use is run locally it is equivalent to

$ git config user.name "Name for specified profile"
$ git config user.email "email-for-specified@profile.com"
$ git config user.signingkey "SIGNINGKEY"

Profiles List

$ git-profile list

Available profiles:
    Github
    Home
    Office

License

MIT © Zeeshan Ahmad

统计信息

  • 总下载量: 127
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 232
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 232
  • Watchers: 4
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固