blob: 798f8728938453f6e3ed005c9b50fae9014ffc6c [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= git-receive-pack
Shawn O. Pearce93599bb2009-06-16 07:27:53 -07002
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003== NAME
Shawn O. Pearce93599bb2009-06-16 07:27:53 -07004git-receive-pack - Receive what is pushed into the repository
5
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006== SYNOPSIS
Michael Ochmanne2d76a12016-06-23 17:07:37 +02007[verse]
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08008--
Michael Ochmanne2d76a12016-06-23 17:07:37 +02009_git receive-pack_
Edwin Kempin73b26982012-07-16 13:53:22 +020010 [--reviewer <address> | --re <address>]
11 [--cc <address>]
12 <project>
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080013--
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070014
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080015== DESCRIPTION
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070016Invoked by 'git push' and updates the project's repository with
17the information fed from the 'git push' end.
18
19End users can supply options to this command by passing them through
20to 'git push', which will relay them automatically.
21
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080022== OPTIONS
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070023
24<project>::
25 The remote repository that will receive the pushed objects,
26 and create (or update) changes. Within Gerrit Code Review
Shawn O. Pearce47769242011-06-14 16:40:48 -070027 this is the name of a project. The optional leading `/`
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070028 and or trailing `.git` suffix will be removed, if supplied.
29
Shawn O. Pearce47769242011-06-14 16:40:48 -070030--reviewer <address>::
31--re <address>::
Shawn Pearce69928a62013-02-24 18:01:27 -080032 Automatically add <address> as a reviewer to any change.
33 Deprecated, use `refs/for/branch%r=address` instead.
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070034
Shawn O. Pearce47769242011-06-14 16:40:48 -070035--cc <address>::
Shawn Pearce69928a62013-02-24 18:01:27 -080036 Carbon-copy <address> on the created or updated changes.
37 Deprecated, use `refs/for/branch%cc=address` instead.
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070038
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080039== ACCESS
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070040Any user who has configured an SSH key.
41
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080042== EXAMPLES
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070043
44Send a review for a change on the master branch to charlie@example.com:
Michael Ochmannb99feab2016-07-06 14:10:22 +020045----
Shawn Pearce69928a62013-02-24 18:01:27 -080046 git push ssh://review.example.com:29418/project HEAD:refs/for/master%r=charlie@example.com
Michael Ochmannb99feab2016-07-06 14:10:22 +020047----
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070048
Shawn O. Pearced50c94e2010-07-15 12:24:11 -070049Send reviews, but tagging them with the topic name 'bug42':
Michael Ochmannb99feab2016-07-06 14:10:22 +020050----
Shawn Pearce69928a62013-02-24 18:01:27 -080051 git push ssh://review.example.com:29418/project HEAD:refs/for/master%r=charlie@example.com,topic=bug42
Michael Ochmannb99feab2016-07-06 14:10:22 +020052----
Shawn O. Pearced50c94e2010-07-15 12:24:11 -070053
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070054Also CC two other parties:
Michael Ochmannb99feab2016-07-06 14:10:22 +020055----
Shawn Pearce69928a62013-02-24 18:01:27 -080056 git push ssh://review.example.com:29418/project HEAD:refs/for/master%r=charlie@example.com,cc=alice@example.com,cc=bob@example.com
Michael Ochmannb99feab2016-07-06 14:10:22 +020057----
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070058
59Configure a push macro to perform the last action:
Michael Ochmannb99feab2016-07-06 14:10:22 +020060----
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070061 git config remote.charlie.url ssh://review.example.com:29418/project
Shawn Pearce69928a62013-02-24 18:01:27 -080062 git config remote.charlie.push HEAD:refs/for/master%r=charlie@example.com,cc=alice@example.com,cc=bob@example.com
Michael Ochmannb99feab2016-07-06 14:10:22 +020063----
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070064
65afterwards `.git/config` contains the following:
Shawn O. Pearce47769242011-06-14 16:40:48 -070066----
67[remote "charlie"]
68 url = ssh://review.example.com:29418/project
Shawn Pearce69928a62013-02-24 18:01:27 -080069 push = HEAD:refs/for/master%r=charlie@example.com,cc=alice@example.com,cc=bob@example.com
Shawn O. Pearce47769242011-06-14 16:40:48 -070070----
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070071
72and now sending a new change for review to charlie, CC'ing both
73alice and bob is much easier:
Michael Ochmannb99feab2016-07-06 14:10:22 +020074----
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070075 git push charlie
Michael Ochmannb99feab2016-07-06 14:10:22 +020076----
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070077
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080078== SEE ALSO
Shawn O. Pearce93599bb2009-06-16 07:27:53 -070079
80* link:user-upload.html[Uploading Changes]
81
82GERRIT
83------
84Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -070085
86SEARCHBOX
87---------