I would prefer not rely on settings in ~/.ssh if possible, we have been copying the private key to the server and creating a git.sh script
```
#!/bin/sh
exec ssh -i "/opt/deploy/git_identity" -o "StrictHostKeyChecking no" "$@"
```

Then when calling git add this to your task:
```
environment:
  GIT_SSH: /path/to/git_ssh.sh
```

If key forwarding does work for what you are doing you can just include the `-o "StrictHostKeyChecking no" ` in your git.sh script and use the GIT_SSH env.