GithubHelp home page GithubHelp logo

waspar / git-profile Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ziishaned/git-profile

0.0 2.0 0.0 52 KB

Utility that helps you switch git configurations with ease.

License: MIT License

PHP 100.00%

git-profile's Introduction

git-profile

Build Status Latest Version Software License

:octocat: Utility that helps you switch git configurations with ease

Preface

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

; Office Profile
Name: John Doe
Email: [email protected]

; Personal Profile
Name: John Doe
Email: [email protected] 

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

  • 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

Examples

Find some of the sample usages below

Adding Profiles

$ git profile add

[+] Enter profile title: Office

[+] Enter Name:  John Doe
[+] Enter Email: [email protected]

[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: [email protected] 

Updating Profile

$ git profile update "Office"

[+] Enter Name:  Jane Doe
[+] Enter Email: [email protected]

[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: [email protected]

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 protected]"

License

MIT © Zeeshan Ahmed

git-profile's People

Contributors

ziishaned avatar adam-paterson avatar

Watchers

James Cloos avatar Waspar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.