@@ -13,3 +13,61 @@ title: Git DB Commits API v3 | developer.github.com
1313<%= headers 200 %>
1414<%= json : commit %>
1515
16+ ## Create a Commit
17+
18+ POST /git/:user/:repo/commit
19+
20+ ### Parameters
21+
22+ message
23+ : _ String_ of the commit message
24+
25+ tree
26+ : _ String_ of the SHA of the tree object this commit points to
27+
28+ parents
29+ : _ Array_ of the SHAs of the commits that were the parents of this
30+ commit. If omitted or empty, the commit will be written as a root
31+ commit. For a single parent, an array of one SHA should be provided,
32+ for a merge commit, an array of more than one should be provided.
33+
34+ ### Optional Parameters
35+
36+ The ` committer ` section is optional and will be filled with the ` author `
37+ data if omitted. If the ` author ` section is omitted, it will be filled
38+ in with the authenticated users information and the current date.
39+
40+
41+ author.name
42+ : _ String_ of the name of the author of the commit
43+
44+ author.email
45+ : _ String_ of the email of the author of the commit
46+
47+ author.date
48+ : _ Timestamp_ of when this commit was authored
49+
50+ committer.name
51+ : _ String_ of the name of the committer of the commit
52+
53+ committer.email
54+ : _ String_ of the email of the committer of the commit
55+
56+ committer.date
57+ : _ Timestamp_ of when this commit was committed
58+
59+ ### Example Input
60+
61+ <%= json "message"=> "my commit message", \
62+ "author"=> \
63+ {"name" => "file.rb", "email" => "scott@github.com ", \
64+ "date" => "2008-07-09T16:13:30+12:00"}, \
65+ "parents"=>[ "7d1b31e74ee336d15cbd21741bc88a537ed063a0"] , \
66+ "tree"=>"827efc6d56897b048c772eb4087f854f46256132" %>
67+
68+ ### Response
69+
70+ <%= headers 201,
71+ : Location => "https://api.github.com/git/:user/:repo/commit/:sha " %>
72+ <%= json : sha => "771696840881ef6119cd74e9eb06305dddca8632", : size => 40 %>
73+
0 commit comments