I recently created a new Android app on my local dev box, but when I went to copy it to my git server using:
scp -r -P 9876 AppProjectFolder.git email@example.com:/opt/git
I got this:
fatal: unrecognized command ‘scp -r -t /opt/git’
After researching, I found it is due the git user on my server using git-shell (to restrict commands that can be used). However, I’m sure I used to be able to use the scp command even when using git-shell. I couldn’t find the root cause, so I just modified /etc/passwd to set the git user to use /bin/bash temporarily, then switched it back after the files were copied. My server is running Fedora 19, if anyone knows what can cause this and/or how to fix it please post a comment.