Skip to content

Commit 21d8d7e

Browse files
committed
Document the push refspec format
Taken from `git help push` and adapted to match the supported features only. Future iterations of this feature may include better support for git "SHA-1 expression", documented in `git help push` as: > any arbitrary "SHA-1 expression", such as master~4 or HEAD (see gitrevisions(7)).
1 parent 617ae9f commit 21d8d7e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

options.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,14 @@ type PushOptions struct {
198198
RemoteName string
199199
// RemoteURL overrides the remote repo address with a custom URL
200200
RemoteURL string
201-
// RefSpecs specify what destination ref to update with what source
202-
// object. A refspec with empty src can be used to delete a reference.
201+
// RefSpecs specify what destination ref to update with what source object.
202+
//
203+
// The format of a <refspec> parameter is an optional plus +, followed by
204+
// the source object <src>, followed by a colon :, followed by the destination ref <dst>.
205+
// The <src> is often the name of the branch you would want to push, but it can be a SHA-1.
206+
// The <dst> tells which ref on the remote side is updated with this push.
207+
//
208+
// A refspec with empty src can be used to delete a reference.
203209
RefSpecs []config.RefSpec
204210
// Auth credentials, if required, to use with the remote repository.
205211
Auth transport.AuthMethod

0 commit comments

Comments
 (0)