Skip to content

Instantly share code, notes, and snippets.

View vianho's full-sized avatar
🦕
meow

Silviana vianho

🦕
meow
View GitHub Profile
@vianho
vianho / README.md
Last active October 11, 2021 07:15
Git init then select the correct github account for git config

This is a simple bash script for people that uses more than 1 github account on 1 machine to pick which account to use when a git repository is initiated. This script uses the git config --local command to set the username and email for the current repository.

How to use:

  1. Create the script file. I created a new directory on home called Scripts to store my scripts.
  2. Copy and paste gini script to the new file.
  3. Fill in the appropriate usernames and emails, and feel free to add more elif statements if you have more accounts.
  4. Allow users to execute the gini script by changing the permission with chmod +x gini
  5. Open a file where you store the aliases for your shell, e.g. .bashrc, bash_aliases, .zshrc, etc.
  6. Set an alias for gini on the file that you've opened with alias gini=/path/to/script.