mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Add git-paste for sending patches to pastebin
This commit is contained in:
parent
f7d127b360
commit
5b62b4a884
25
Commands.md
25
Commands.md
|
|
@ -39,6 +39,7 @@
|
|||
- [`git missing`](#git-missing)
|
||||
- [`git mr`](#git-mr)
|
||||
- [`git obliterate`](#git-obliterate)
|
||||
- [`git paste`](#git-paste)
|
||||
- [`git pr`](#git-pr)
|
||||
- [`git psykorebase`](#git-psykorebase)
|
||||
- [`git pull-request`](#git-pull-request)
|
||||
|
|
@ -1273,6 +1274,30 @@ Switched to branch 'mr/51'
|
|||
Just like [git pr](#git-pr), `git mr` accepts a `clean` argument to trash all
|
||||
`mr/` branches. Ensure current branch is not one.
|
||||
|
||||
## git paste
|
||||
|
||||
Sends commits to a pastebin site using pastebinit.
|
||||
|
||||
By default it sends the commits between your current branch
|
||||
and the branch your current branch is based on (the upstream branch).
|
||||
|
||||
``` bash
|
||||
$ git paste
|
||||
https://paste.debian.net/1234567/
|
||||
```
|
||||
|
||||
All options are passed to `git format-patch --stdout`
|
||||
so you can also pass options understood by `git-rev-parse(1)`
|
||||
in order to select a different set of commits.
|
||||
|
||||
``` bash
|
||||
$ git paste @^
|
||||
https://paste.debian.net/1234567/
|
||||
```
|
||||
|
||||
See the [pastebinit documentation](https://manpages.debian.org/pastebinit)
|
||||
for information about how to chose a different pastebin site to the default.
|
||||
|
||||
## git pr
|
||||
|
||||
Checks out a pull request from GitHub
|
||||
|
|
|
|||
5
bin/git-paste
Executable file
5
bin/git-paste
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -o pipefail
|
||||
test $# -ne 0 || set -- '@{u}'
|
||||
git format-patch --stdout "$@" | pastebinit -f diff
|
||||
|
|
@ -476,6 +476,7 @@ zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \
|
|||
missing:'show commits missing from another branch' \
|
||||
mr:'checks out a merge request locally' \
|
||||
obliterate:'rewrite past commits to remove some files' \
|
||||
paste:'send patches to pastebin sites' \
|
||||
pr:'checks out a pull request locally' \
|
||||
psykorebase:'rebase a branch with a merge commit' \
|
||||
pull-request:'create pull request to GitHub project' \
|
||||
|
|
|
|||
51
man/git-paste.md
Normal file
51
man/git-paste.md
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
git-paste(1) -- Send patches to pastebin for chat conversations
|
||||
===============================================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
`git-paste` <git format-patch options>
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Send patches to pastebin for chat conversations using pastebinit.
|
||||
The syntax highlighting will be set to 'diff'.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
<git format-patch options>
|
||||
|
||||
All options are passed directly to `git format-patch`.
|
||||
Given no arguments, `git-paste` passes `@{u}` to `git format-patch`.
|
||||
|
||||
## CONFIGURATION
|
||||
|
||||
The pastebinit software chooses the most appropriate pastebin site
|
||||
for your operating system and the [pastebinit documentation](https://manpages.debian.org/pastebinit)
|
||||
contains details of how to configure it to use a different site.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
Pastebin the patches between the current branch and its upstream:
|
||||
|
||||
$ git paste
|
||||
$ git paste @{u}
|
||||
|
||||
Pastebin the latest commit:
|
||||
|
||||
$ git paste -1
|
||||
|
||||
Pastebin the latest three commits:
|
||||
|
||||
$ git paste -3
|
||||
|
||||
## AUTHOR
|
||||
|
||||
Written by Paul Wise <<pabs3@bonedaddy.net>>
|
||||
|
||||
## REPORTING BUGS
|
||||
|
||||
<<https://github.com/tj/git-extras/issues>>
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
<<https://github.com/tj/git-extras>>
|
||||
Loading…
Reference in a new issue