|
| 1 | +# amend |
| 2 | + |
| 3 | +Amend this existing commit with all non-nullable values |
| 4 | + |
| 5 | +This creates a new commit that is exactly the same as the old commit, |
| 6 | +except that any non-nullable values will be updated. The new commit has |
| 7 | +the same parents as the old commit. |
| 8 | + |
| 9 | +## Signature |
| 10 | + |
| 11 | +```ts |
| 12 | +class Commit { |
| 13 | + amend(options?: AmendOptions, tree?: Tree): string; |
| 14 | +} |
| 15 | +``` |
| 16 | + |
| 17 | +### Parameters |
| 18 | + |
| 19 | +<ul class="param-ul"> |
| 20 | + <li class="param-li param-li-root"> |
| 21 | + <span class="param-name">options</span><span class="param-type">null | AmendOptions</span> |
| 22 | + <br> |
| 23 | + <p class="param-description">Options for amending commit.</p> |
| 24 | + <ul class="param-ul"> |
| 25 | + <li class="param-li"> |
| 26 | + <span class="param-name">author</span><span class="param-type">SignaturePayload</span> |
| 27 | + <br> |
| 28 | + <p class="param-description">Signature for author.</p> |
| 29 | + <ul class="param-ul"> |
| 30 | + <li class="param-li"> |
| 31 | + <span class="param-name">email</span><span class="param-required">required</span> · <span class="param-type">string</span> |
| 32 | + <br> |
| 33 | + <p class="param-description">Email on the signature.</p> |
| 34 | + </li> |
| 35 | + <li class="param-li"> |
| 36 | + <span class="param-name">name</span><span class="param-required">required</span> · <span class="param-type">string</span> |
| 37 | + <br> |
| 38 | + <p class="param-description">Name on the signature.</p> |
| 39 | + </li> |
| 40 | + <li class="param-li"> |
| 41 | + <span class="param-name">timeOptions</span><span class="param-type">SignatureTimeOptions</span> |
| 42 | + <br> |
| 43 | + <ul class="param-ul"> |
| 44 | + <li class="param-li"> |
| 45 | + <span class="param-name">offset</span><span class="param-type">number</span> |
| 46 | + <br> |
| 47 | + <p class="param-description">Timezone offset, in minutes</p> |
| 48 | + </li> |
| 49 | + <li class="param-li"> |
| 50 | + <span class="param-name">timestamp</span><span class="param-required">required</span> · <span class="param-type">number</span> |
| 51 | + <br> |
| 52 | + <p class="param-description">Time in seconds, from epoch</p> |
| 53 | + </li> |
| 54 | + </ul> |
| 55 | + </li> |
| 56 | + </ul> |
| 57 | + </li> |
| 58 | + <li class="param-li"> |
| 59 | + <span class="param-name">committer</span><span class="param-type">SignaturePayload</span> |
| 60 | + <br> |
| 61 | + <p class="param-description">Signature for committer.</p> |
| 62 | + <ul class="param-ul"> |
| 63 | + <li class="param-li"> |
| 64 | + <span class="param-name">email</span><span class="param-required">required</span> · <span class="param-type">string</span> |
| 65 | + <br> |
| 66 | + <p class="param-description">Email on the signature.</p> |
| 67 | + </li> |
| 68 | + <li class="param-li"> |
| 69 | + <span class="param-name">name</span><span class="param-required">required</span> · <span class="param-type">string</span> |
| 70 | + <br> |
| 71 | + <p class="param-description">Name on the signature.</p> |
| 72 | + </li> |
| 73 | + <li class="param-li"> |
| 74 | + <span class="param-name">timeOptions</span><span class="param-type">SignatureTimeOptions</span> |
| 75 | + <br> |
| 76 | + <ul class="param-ul"> |
| 77 | + <li class="param-li"> |
| 78 | + <span class="param-name">offset</span><span class="param-type">number</span> |
| 79 | + <br> |
| 80 | + <p class="param-description">Timezone offset, in minutes</p> |
| 81 | + </li> |
| 82 | + <li class="param-li"> |
| 83 | + <span class="param-name">timestamp</span><span class="param-required">required</span> · <span class="param-type">number</span> |
| 84 | + <br> |
| 85 | + <p class="param-description">Time in seconds, from epoch</p> |
| 86 | + </li> |
| 87 | + </ul> |
| 88 | + </li> |
| 89 | + </ul> |
| 90 | + </li> |
| 91 | + <li class="param-li"> |
| 92 | + <span class="param-name">message</span><span class="param-type">string</span> |
| 93 | + <br> |
| 94 | + <p class="param-description">Full message for this commit</p> |
| 95 | + </li> |
| 96 | + <li class="param-li"> |
| 97 | + <span class="param-name">messageEncoding</span><span class="param-type">string</span> |
| 98 | + <br> |
| 99 | + <p class="param-description">The encoding for the message in the commit, represented with a standard encoding name. E.g. "UTF-8". If NULL, no encoding header is written and UTF-8 is assumed.</p> |
| 100 | + </li> |
| 101 | + <li class="param-li"> |
| 102 | + <span class="param-name">updateRef</span><span class="param-type">string</span> |
| 103 | + <br> |
| 104 | + <p class="param-description">If not NULL, name of the reference that will be updated to point to this commit. If the reference is not direct, it will be resolved to a direct reference. Use "HEAD" to update the HEAD of the current branch and make it point to this commit. If the reference doesn't exist yet, it will be created. If it does exist, the first parent must be the tip of this branch.</p> |
| 105 | + </li> |
| 106 | + </ul> |
| 107 | + </li> |
| 108 | + <li class="param-li param-li-root"> |
| 109 | + <span class="param-name">tree</span><span class="param-type">null | Tree</span> |
| 110 | + <br> |
| 111 | + <p class="param-description">Tree to use for amending commit.</p> |
| 112 | + </li> |
| 113 | +</ul> |
| 114 | + |
| 115 | +### Returns |
| 116 | + |
| 117 | +<ul class="param-ul"> |
| 118 | + <li class="param-li param-li-root"> |
| 119 | + <span class="param-type">string</span> |
| 120 | + <br> |
| 121 | + <p class="param-description">ID(SHA1) of amended commit.</p> |
| 122 | + </li> |
| 123 | +</ul> |
0 commit comments