> ## Content Index
> Fetch the complete content index at: https://www.bagz.fr/llms.txt
> Use this file to discover other available public pages before exploring further.

# Perform git commands with a specific ssh key
- URL: https://www.bagz.fr/perform-git-commands-with-a-specific-ssh-key/
- Published: 2016-05-09T09:21:42.000Z
- Updated: 2016-05-09T09:21:42.000Z
- Author: bgazui
- Tags: Linux, #Migrated-1790668826633, #wp, #wp-post, #Import 2026-09-29 08:00

It's sometimes necessary to execute one git command with a special SSH key rather that the one you're running with (for example on a remote console).

This can be easily done by using such command:

ssh-agent bash -c 'ssh-add /home/myuser/.ssh/github.key; git pull git@github.com:MYPROJECT/myproject.git'