Ssh – Git config forwarding

gitsshssh-agent

I don't know if this even possible or not.

I was wondering if there is any way like SSH Agent forwarding by which we can forward our .gitconfig on the remote server, and git automatically picks the settings up when making commits.

Best Answer

Try sshrc.

Install sshrc on your local machine.

Add the following line to ~/.sshrc on your local machine:

cp "$SSHHOME/.sshrc.d/.gitconfig" ~/.gitconfig

Create ~/.sshrc.d on your local machine: mkdir ~/.sshrc.d

Create a symlink:

ln -s ~/.gitconfig ~/.sshrc.d/.gitconfig

And try sshrc me@myserver

See also:

Related Question