https://github.com/bryan07312002/git-account-manager
A small and quick project just for easily manage git config name and email
https://github.com/bryan07312002/git-account-manager
git go golang
Last synced: about 2 months ago
JSON representation
A small and quick project just for easily manage git config name and email
- Host: GitHub
- URL: https://github.com/bryan07312002/git-account-manager
- Owner: Bryan07312002
- Created: 2023-08-31T18:21:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-01T13:22:01.000Z (almost 3 years ago)
- Last Synced: 2023-09-01T14:53:48.533Z (almost 3 years ago)
- Topics: git, go, golang
- Language: Go
- Homepage:
- Size: 1.97 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Git account manager
A small and quick project just for easily manage git config name and email
## How to use
To register a new account
```sh
$ gam --register --account
username:
{account_username}
email:
{account_mail}
```
To list all registred accounts
```sh
$ gam --list --account
```
To register a new repository
```sh
$ gam --register --repository --accId {account_uuid_given_in_list_comand} --path[this flag is optional] {desired_path}
```
To list all registred repositories
```sh
$ gam --list --repository
```
To set a account in git based at current repository
```sh
$ gam --set
```
To set a account in git based at choosen repository
```sh
$ gam --set --path {desired_repository_path}
```
## How to install
### Linux
Pre requisites
- go
- git
Download this repository
```sh
$ git clone https://github.com/Bryan07312002/git-account-manager.git
$ cd git-account-manager
```
Build the binary
```sh
$ go build ./src/*.go
```
Send to /bin
```sh
$ sudo mv accounts /bin/gam
```
create basic json folders and files
```sh
$ mkdir ~/.gam_config
$ touch ~/.gam_config/git_accounts.json
$ touch ~/.gam_config/repositories.json
$ echo [] > ~/.gam_config/git_accounts.json
$ echo [] > ~/.gam_config/repositories.json
```
add this to your .bashrc file
```bash
export GAM=~/.gam_config
function git() {
command gam --set # Run gam set command to set right account
command git "$@" # Run the original git command
}
```