You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/v3/git/commits.md
+13-26Lines changed: 13 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,17 +22,12 @@ title: Git Commits | GitHub API
22
22
23
23
### Parameters
24
24
25
-
message
26
-
: _String_ of the commit message
25
+
Name | Type | Description | Required? | Default
26
+
----|------|--------------|-----------|---------
27
+
`message`|`string` | The commit message|**YES**|
28
+
`tree`|`string` | The SHA of the tree object this commit points to|**YES**|
29
+
`parents`|| The SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided.|**YES**|
27
30
28
-
tree
29
-
: _String_ of the SHA of the tree object this commit points to
30
-
31
-
parents
32
-
: _Array_ of the SHAs of the commits that were the parents of this
33
-
commit. If omitted or empty, the commit will be written as a root
34
-
commit. For a single parent, an array of one SHA should be provided,
35
-
for a merge commit, an array of more than one should be provided.
36
31
37
32
### Optional Parameters
38
33
@@ -41,23 +36,15 @@ data if omitted. If the `author` section is omitted, it will be filled
41
36
in with the authenticated user's information and the current date.
42
37
43
38
44
-
author.name
45
-
: _String_ of the name of the author of the commit
46
-
47
-
author.email
48
-
: _String_ of the email of the author of the commit
49
-
50
-
author.date
51
-
: _Timestamp_ of when this commit was authored
52
-
53
-
committer.name
54
-
: _String_ of the name of the committer of the commit
55
-
56
-
committer.email
57
-
: _String_ of the email of the committer of the commit
39
+
Name | Type | Description | Required? | Default
40
+
----|------|--------------|-----------|---------
41
+
`author.name`|| The name of the author of the commit| |
42
+
`author.email`|| The email of the author of the commit| |
43
+
`author.date`|| Indicates when this commit was authored. The time should be passed in as UTC in the ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.|**YES**|
44
+
`committer.name`|| The name of the committer of the commit| |
45
+
`committer.email`|| The email of the committer of the commit| |
46
+
`committer.date`|| Indicates when this commit was committed. The time should be passed in as UTC in the ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.|**YES**|
Copy file name to clipboardExpand all lines: content/v3/git/refs.md
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,12 +46,11 @@ For a full refs listing, you'll get something that looks like:
46
46
47
47
### Parameters
48
48
49
-
ref
50
-
: _String_ of the name of the fully qualified reference (ie: `refs/heads/master`).
51
-
If it doesn't start with 'refs' and have at least two slashes, it will be rejected.
49
+
Name | Type | Description | Required? | Default
50
+
----|------|--------------|-----------|---------
51
+
`ref`|| The name of the fully qualified reference (ie: `refs/heads/master`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected.| |
52
+
`sha`|| The SHA1 value to set this reference to| |
52
53
53
-
sha
54
-
: _String_ of the SHA1 value to set this reference to
55
54
56
55
### Input
57
56
@@ -69,13 +68,11 @@ sha
69
68
70
69
### Parameters
71
70
72
-
sha
73
-
: _String_ of the SHA1 value to set this reference to
71
+
Name | Type | Description | Required? | Default
72
+
----|------|--------------|-----------|---------
73
+
`sha`|| The SHA1 value to set this reference to| |
74
+
`force`|| Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to `false` will make sure you're not overwriting work. | |`false`
74
75
75
-
force
76
-
: _Boolean_ indicating whether to force the update or to make sure the
77
-
update is a fast-forward update. The default is `false`, so leaving this
78
-
out or setting it to `false` will make sure you're not overwriting work.
Copy file name to clipboardExpand all lines: content/v3/git/trees.md
+12-24Lines changed: 12 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,33 +36,21 @@ a new tree out.
36
36
37
37
### Parameters
38
38
39
-
base_tree
40
-
: optional _String_ of the SHA1 of the tree you want to update with new data.
41
-
If you don't set this, the commit will be created on top of everything,
42
-
however, it will only contain your change, the rest of your files will show up
43
-
as deleted.
39
+
Name | Type | Description | Required? | Default
40
+
----|------|--------------|-----------|---------
41
+
`base_tree`| `string` | The SHA1 of the tree you want to update with new data. If you don't set this, the commit will be created on top of everything; however, it will only contain your change, the rest of your files will show up as deleted.| |
42
+
`tree`|`array` of `hash`es | Objects (of `path`, `mode`, `type`, and `sha`) specifying a tree structure|**YES**|
44
43
45
-
tree
46
-
: _Array_ of _Hash_ objects (of `path`, `mode`, `type` and `sha`) specifying a
47
-
tree structure
44
+
The `tree` parameter takes the following keys:
48
45
49
-
tree.path
50
-
: _String_ of the file referenced in the tree
46
+
Name | Type | Description | Required? | Default
47
+
----|------|--------------|-----------|---------
48
+
`path`|`string`| The file referenced in the tree| |
49
+
`mode`|`string`| The file mode; one of `100644` for file (blob), `100755` for executable (blob), `040000` for subdirectory (tree), `160000` for submodule (commit), or `120000` for a blob that specifies the path of a symlink| |
50
+
`type`| `string`| Either `blob`, `tree`, or `commit`| |
51
+
`sha`|`string`| The SHA1 checksum ID of the object in the tree| |
52
+
`content`|`string` | The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or `tree.sha`.| |
51
53
52
-
tree.mode
53
-
: _String_ of the file mode - one of `100644` for file (blob), `100755` for
54
-
executable (blob), `040000` for subdirectory (tree), `160000` for submodule
55
-
(commit) or `120000` for a blob that specifies the path of a symlink
56
-
57
-
tree.type
58
-
: _String_ of `blob`, `tree`, `commit`
59
-
60
-
tree.sha
61
-
: _String_ of SHA1 checksum ID of the object in the tree
62
-
63
-
tree.content
64
-
: _String_ of content you want this file to have - GitHub will write this blob
65
-
out and use that SHA for this entry. Use either this or `tree.sha`
0 commit comments