|
23 | 23 | - [`git repl`](#git-repl) |
24 | 24 | - [`git undo`](#git-undo) |
25 | 25 | - [`git gh-pages`](#git-gh-pages) |
| 26 | + - [`git scp`](#git-scp) |
26 | 27 | - [`git setup`](#git-setup) |
27 | 28 | - [`git touch`](#git-touch) |
28 | 29 | - [`git obliterate`](#git-obliterate) |
@@ -593,6 +594,41 @@ git undo 3 |
593 | 594 |
|
594 | 595 | 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. |
595 | 596 |
|
| 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 | + |
596 | 632 | ## git touch |
597 | 633 |
|
598 | 634 | Call `touch` on the given file, and add it to the current index. One-step creation of new files. |
|
0 commit comments