Is it possible to switch the user to the git repository?

We have an intermediate server that we use git to control very simply: locally, git commit / push, and then git pull the server. I would like for me to be able to switch the user to a copy of the server so that I can run git pull and not the one who set up the environment. Any idea if this is possible?

+7
git ssh ssh-keys
source share
2 answers

Just chown -R (or chgrp -R and chmod -R g+w ) the repository where you want to include git pull . Git does not have its own authorization check, it fixes it no matter what access mechanism you use. In the case of local access and SSH access, as you seem to be using, this is just normal OS file ownership.

+5
source share

There is a large github repo called gitswitch that will allow you to switch between git users: https://github.com/joealba/gitswitch

From the readme file:

It is easy to set / switch current git user information for the git.git / config repo or your global ~ / .gitconfig file.

This stone should come in handy if you have a job and personal Vaults. It can also help in switching between users while pairing.

Most likely enter "git config user.email" me@work.com "etc. or type" work gitswitch switch "? If you answered last, check this gem.

+3
source share

All Articles