Skip to content

Commit 2a9ce31

Browse files
committed
git scp tj#300
1 parent fc89e17 commit 2a9ce31

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Commands.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- [`git repl`](#git-repl)
2424
- [`git undo`](#git-undo)
2525
- [`git gh-pages`](#git-gh-pages)
26+
- [`git scp`](#git-scp)
2627
- [`git setup`](#git-setup)
2728
- [`git touch`](#git-touch)
2829
- [`git obliterate`](#git-obliterate)
@@ -593,6 +594,41 @@ git undo 3
593594
594595
Set up a git repository (if one doesn't exist), add all files, and make an initial commit. `dir` defaults to the current working directory.
595596

597+
## git scp
598+
599+
A convenient way to copy files from the current working tree to the working directory of a remote repository. If a `<commits>...` is provided, only files that has changed within the commit range will be copied.
600+
601+
Internally this script uses `rsync` and not `scp` as the name suggests.
602+
603+
`git-rscp` - The reverse of `git-scp`. Copies specific files from the working directory of a remote repository to the current working directory.
604+
605+
### Examples
606+
607+
Copy unstaged files to remote. Useful when you want to make quick test without making any commits
608+
609+
$ git scp staging
610+
611+
Copy staged and unstaged files to remote
612+
613+
$ git scp staging HEAD
614+
615+
Copy files that has been changed in the last commit, plus any staged or unstaged files to remote
616+
617+
$ git scp staging HEAD~1
618+
619+
Copy files that has been changed between now and a tag
620+
621+
$ git scp staging v1.2.3
622+
623+
Copy specific files
624+
625+
$ git scp staging index.html .gitignore .htaccess
626+
627+
Copy specific directory
628+
629+
$ git scp staging js/vendor/
630+
631+
596632
## git touch
597633

598634
Call `touch` on the given file, and add it to the current index. One-step creation of new files.

0 commit comments

Comments
 (0)