This is just a small private project developed in lack of a proper solution to manage multiple developers using the same computer/server working in the same git repository.
- Pair Programming on one machine with changing teams and combinations
- Multiple admins editing and commiting files on a server
- Using multiple mail adresses for diffrent purposes (e.g. private use, publishing on github, etc.)
- Committing as someone else (e.g. when collaborating with somone without enough git knowledge)
The magic happens in credch.py. It's really just a small python script that reads the config file (gitCredentials.json
) and interacts with the user.
To test it just rename the demo config file gitCredentialsDemo.json
to gitCredentials.json
and run the script.
python credch.py
To use the script in your existing repository rather than in this cloned one, some further steps are required:
The easiest way is to create an alias, so that the script can be called from any other directory:
alias gitCred='python /<Path>/<to>/<this>/<repository>/credch.py'
To make this alias 'permanent' add the previous command to your ~/.bashrc
.
Change to your repository where you want to control the git-credentials. Then call credch.py
(If you followed the previous steps you can enter gitCred
).
The script should exit with a message that it could not find a configuration file.
To create one, copy the demo file gitCredentialsDemo.json
to the toplevel directory of your repository and rename it to gitCredentials.json
.
Then run credch.py
again.
credch.py -h