GIT-SCP(1)
π
GIT-SCP(1) β the git-extras era π
okay bestie, welcome to the manual page for git-scp π«Ά (yes it's from Git Extras, and yes it's about to be your new fave)
β¨ NAME β¨
git-scp β copy files to an SSH compatible git-remote π
π SYNOPSIS π
`git scp` -h|help|?
`git scp` <remote> [<commits>...|<path>...]
`git rscp` <remote> <path>
π¦ DESCRIPTION π¦
so here's the vibe: this is a convenient way to copy files from the current working tree over to the working directory of a remote repository β¨ and if you hand it a <commits>..., then only the files that changed within that commit range get copied. selective, queen behavior π
lowkey important tea: internally this script uses rsync and not scp, even though the name says scp π the name is a little liar, but a cute one.
and bestie, there's git-rscp β the reverse of git-scp. it copies specific files from the working directory of a remote repository into the current working directory. it's giving mirror-but-make-it-flip π«
π OPTIONS π
<remote>β the git remote where you wanna copy your files. that's the destination, the moment, the place π«Ά<commits>...β any commit, commit range or tree. it usesgit-diff(1) under the hood, no cap<path>...β the<paths>parameters, when you give them, are used to limit the diff to the named paths (and yes you can give directory names and get a diff for all the files under them β directories ate π )
πΈ GIT CONFIGS πΈ
wanna sanitize files using dos2unix before copying them? say less:
$ git config --global --add extras.scp.sanitize dos2unix
or you can run the files through PHP lint (i.e. php -l) before copying them:
$ git config --global --add extras.scp.sanitize php_lint
π EXAMPLES π
first things first β make sure you have git-remote(1) setup, bestie:
$ git remote add staging myStagingServer:/var/www/html
copy unstaged files to remote. obsessed, so useful when you wanna make a quick test without making any commits π₯
$ git scp staging
copy staged and unstaged files to remote:
$ git scp staging HEAD
copy files that has been changed in the last commit, plus any staged or unstaged files to remote:
$ git scp staging HEAD~1
copy files that has been changed between now and a tag:
$ git scp staging v1.2.3
copy specific files:
$ git scp staging index.html .gitignore .htaccess
copy specific directory:
$ git scp staging js/vendor/
copy files from specific directory to multiple servers (not the for loop doing the most, iconic):
$ for dest in web1 web2 web3; do
git diff --name-only 4.8.3 4.8.2 app/code/community app/design skin/ | xargs git scp $dest
done;
π«Ά AUTHOR π«Ά
Written by Chern Jie <lim@chernjie.com> β ty for your service bestie π
π REPORTING BUGS π
found a lil gremlin? report it here:
<https://github.com/chernjie/git-extras/issues>
β SEE ALSO β
<https://github.com/tj/git-extras>
and that's the whole manual, periodt π the source is Git Extras and this page is dated May 2026, so if you're reading it in the future from way back β hey, slay π¦ mwah, go copy some files responsibly π
π¦ where this page comes from
- ubuntu stonking: git-extras 7.5.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms