Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 5 | <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.6.9" /> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 7 | <title>git-add(1)</title> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 8 | <style type="text/css"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 9 | /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ |
| 10 | |
| 11 | /* Default font. */ |
| 12 | body { |
| 13 | font-family: Georgia,serif; |
| 14 | } |
| 15 | |
| 16 | /* Title font. */ |
| 17 | h1, h2, h3, h4, h5, h6, |
| 18 | div.title, caption.title, |
| 19 | thead, p.table.header, |
| 20 | #toctitle, |
| 21 | #author, #revnumber, #revdate, #revremark, |
| 22 | #footer { |
| 23 | font-family: Arial,Helvetica,sans-serif; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | body { |
| 27 | margin: 1em 5% 1em 5%; |
| 28 | } |
| 29 | |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 30 | a { |
| 31 | color: blue; |
| 32 | text-decoration: underline; |
| 33 | } |
| 34 | a:visited { |
| 35 | color: fuchsia; |
| 36 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 37 | |
| 38 | em { |
| 39 | font-style: italic; |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 40 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | strong { |
| 44 | font-weight: bold; |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 45 | color: #083194; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 46 | } |
| 47 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 48 | h1, h2, h3, h4, h5, h6 { |
| 49 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 50 | margin-top: 1.2em; |
| 51 | margin-bottom: 0.5em; |
| 52 | line-height: 1.3; |
| 53 | } |
| 54 | |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 55 | h1, h2, h3 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 56 | border-bottom: 2px solid silver; |
| 57 | } |
| 58 | h2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 59 | padding-top: 0.5em; |
| 60 | } |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 61 | h3 { |
| 62 | float: left; |
| 63 | } |
| 64 | h3 + * { |
| 65 | clear: left; |
| 66 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 67 | h5 { |
| 68 | font-size: 1.0em; |
| 69 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 70 | |
| 71 | div.sectionbody { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 72 | margin-left: 0; |
| 73 | } |
| 74 | |
| 75 | hr { |
| 76 | border: 1px solid silver; |
| 77 | } |
| 78 | |
| 79 | p { |
| 80 | margin-top: 0.5em; |
| 81 | margin-bottom: 0.5em; |
| 82 | } |
| 83 | |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 84 | ul, ol, li > p { |
| 85 | margin-top: 0; |
| 86 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 87 | ul > li { color: #aaa; } |
| 88 | ul > li > * { color: black; } |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 89 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 90 | .monospaced, code, pre { |
| 91 | font-family: "Courier New", Courier, monospace; |
| 92 | font-size: inherit; |
| 93 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 94 | padding: 0; |
| 95 | margin: 0; |
| 96 | } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 97 | pre { |
| 98 | white-space: pre-wrap; |
| 99 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 100 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 101 | #author { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 102 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 103 | font-weight: bold; |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 104 | font-size: 1.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 105 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 106 | #email { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 107 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 108 | #revnumber, #revdate, #revremark { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 109 | } |
| 110 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 111 | #footer { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 112 | font-size: small; |
| 113 | border-top: 2px solid silver; |
| 114 | padding-top: 0.5em; |
| 115 | margin-top: 4.0em; |
| 116 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 117 | #footer-text { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 118 | float: left; |
| 119 | padding-bottom: 0.5em; |
| 120 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 121 | #footer-badges { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 122 | float: right; |
| 123 | padding-bottom: 0.5em; |
| 124 | } |
| 125 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 126 | #preamble { |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 127 | margin-top: 1.5em; |
| 128 | margin-bottom: 1.5em; |
| 129 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 130 | div.imageblock, div.exampleblock, div.verseblock, |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 131 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 132 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 133 | margin-top: 1.0em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 134 | margin-bottom: 1.5em; |
| 135 | } |
| 136 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 137 | margin-top: 2.0em; |
| 138 | margin-bottom: 2.0em; |
| 139 | margin-right: 10%; |
| 140 | color: #606060; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | div.content { /* Block element content. */ |
| 144 | padding: 0; |
| 145 | } |
| 146 | |
| 147 | /* Block element titles. */ |
| 148 | div.title, caption.title { |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 149 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 150 | font-weight: bold; |
| 151 | text-align: left; |
| 152 | margin-top: 1.0em; |
| 153 | margin-bottom: 0.5em; |
| 154 | } |
| 155 | div.title + * { |
| 156 | margin-top: 0; |
| 157 | } |
| 158 | |
| 159 | td div.title:first-child { |
| 160 | margin-top: 0.0em; |
| 161 | } |
| 162 | div.content div.title:first-child { |
| 163 | margin-top: 0.0em; |
| 164 | } |
| 165 | div.content + div.title { |
| 166 | margin-top: 0.0em; |
| 167 | } |
| 168 | |
| 169 | div.sidebarblock > div.content { |
| 170 | background: #ffffee; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 171 | border: 1px solid #dddddd; |
| 172 | border-left: 4px solid #f0f0f0; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 173 | padding: 0.5em; |
| 174 | } |
| 175 | |
| 176 | div.listingblock > div.content { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 177 | border: 1px solid #dddddd; |
| 178 | border-left: 5px solid #f0f0f0; |
| 179 | background: #f8f8f8; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 180 | padding: 0.5em; |
| 181 | } |
| 182 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 183 | div.quoteblock, div.verseblock { |
| 184 | padding-left: 1.0em; |
| 185 | margin-left: 1.0em; |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 186 | margin-right: 10%; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 187 | border-left: 5px solid #f0f0f0; |
| 188 | color: #888; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 189 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 190 | |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 191 | div.quoteblock > div.attribution { |
| 192 | padding-top: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 193 | text-align: right; |
| 194 | } |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 195 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 196 | div.verseblock > pre.content { |
| 197 | font-family: inherit; |
| 198 | font-size: inherit; |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 199 | } |
| 200 | div.verseblock > div.attribution { |
| 201 | padding-top: 0.75em; |
| 202 | text-align: left; |
| 203 | } |
| 204 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 205 | div.verseblock + div.attribution { |
| 206 | text-align: left; |
| 207 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 208 | |
| 209 | div.admonitionblock .icon { |
| 210 | vertical-align: top; |
| 211 | font-size: 1.1em; |
| 212 | font-weight: bold; |
| 213 | text-decoration: underline; |
| 214 | color: #527bbd; |
| 215 | padding-right: 0.5em; |
| 216 | } |
| 217 | div.admonitionblock td.content { |
| 218 | padding-left: 0.5em; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 219 | border-left: 3px solid #dddddd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | div.exampleblock > div.content { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 223 | border-left: 3px solid #dddddd; |
| 224 | padding-left: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 225 | } |
| 226 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 227 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 228 | span.image img { border-style: none; vertical-align: text-bottom; } |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 229 | a.image:visited { color: white; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 230 | |
| 231 | dl { |
| 232 | margin-top: 0.8em; |
| 233 | margin-bottom: 0.8em; |
| 234 | } |
| 235 | dt { |
| 236 | margin-top: 0.5em; |
| 237 | margin-bottom: 0; |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 238 | font-style: normal; |
| 239 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 240 | } |
| 241 | dd > *:first-child { |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 242 | margin-top: 0.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | ul, ol { |
| 246 | list-style-position: outside; |
| 247 | } |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 248 | ol.arabic { |
| 249 | list-style-type: decimal; |
| 250 | } |
| 251 | ol.loweralpha { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 252 | list-style-type: lower-alpha; |
| 253 | } |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 254 | ol.upperalpha { |
| 255 | list-style-type: upper-alpha; |
| 256 | } |
| 257 | ol.lowerroman { |
| 258 | list-style-type: lower-roman; |
| 259 | } |
| 260 | ol.upperroman { |
| 261 | list-style-type: upper-roman; |
| 262 | } |
| 263 | |
| 264 | div.compact ul, div.compact ol, |
| 265 | div.compact p, div.compact p, |
| 266 | div.compact div, div.compact div { |
| 267 | margin-top: 0.1em; |
| 268 | margin-bottom: 0.1em; |
| 269 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 270 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 271 | tfoot { |
| 272 | font-weight: bold; |
| 273 | } |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 274 | td > div.verse { |
| 275 | white-space: pre; |
| 276 | } |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 277 | |
| 278 | div.hdlist { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 279 | margin-top: 0.8em; |
| 280 | margin-bottom: 0.8em; |
| 281 | } |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 282 | div.hdlist tr { |
| 283 | padding-bottom: 15px; |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 284 | } |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 285 | dt.hdlist1.strong, td.hdlist1.strong { |
| 286 | font-weight: bold; |
| 287 | } |
| 288 | td.hdlist1 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 289 | vertical-align: top; |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 290 | font-style: normal; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 291 | padding-right: 0.8em; |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 292 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 293 | } |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 294 | td.hdlist2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 295 | vertical-align: top; |
| 296 | } |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 297 | div.hdlist.compact tr { |
| 298 | margin: 0; |
| 299 | padding-bottom: 0; |
| 300 | } |
| 301 | |
| 302 | .comment { |
| 303 | background: yellow; |
| 304 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 305 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 306 | .footnote, .footnoteref { |
| 307 | font-size: 0.8em; |
| 308 | } |
| 309 | |
| 310 | span.footnote, span.footnoteref { |
| 311 | vertical-align: super; |
| 312 | } |
| 313 | |
| 314 | #footnotes { |
| 315 | margin: 20px 0 20px 0; |
| 316 | padding: 7px 0 0 0; |
| 317 | } |
| 318 | |
| 319 | #footnotes div.footnote { |
| 320 | margin: 0 0 5px 0; |
| 321 | } |
| 322 | |
| 323 | #footnotes hr { |
| 324 | border: none; |
| 325 | border-top: 1px solid silver; |
| 326 | height: 1px; |
| 327 | text-align: left; |
| 328 | margin-left: 0; |
| 329 | width: 20%; |
| 330 | min-width: 100px; |
| 331 | } |
| 332 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 333 | div.colist td { |
| 334 | padding-right: 0.5em; |
| 335 | padding-bottom: 0.3em; |
| 336 | vertical-align: top; |
| 337 | } |
| 338 | div.colist td img { |
| 339 | margin-top: 0.3em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 340 | } |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 341 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 342 | @media print { |
| 343 | #footer-badges { display: none; } |
| 344 | } |
| 345 | |
| 346 | #toc { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 347 | margin-bottom: 2.5em; |
| 348 | } |
| 349 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 350 | #toctitle { |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 351 | color: #527bbd; |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 352 | font-size: 1.1em; |
| 353 | font-weight: bold; |
| 354 | margin-top: 1.0em; |
| 355 | margin-bottom: 0.1em; |
| 356 | } |
| 357 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 358 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 359 | margin-top: 0; |
| 360 | margin-bottom: 0; |
| 361 | } |
| 362 | div.toclevel2 { |
| 363 | margin-left: 2em; |
| 364 | font-size: 0.9em; |
| 365 | } |
| 366 | div.toclevel3 { |
| 367 | margin-left: 4em; |
| 368 | font-size: 0.9em; |
| 369 | } |
| 370 | div.toclevel4 { |
| 371 | margin-left: 6em; |
| 372 | font-size: 0.9em; |
| 373 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 374 | |
| 375 | span.aqua { color: aqua; } |
| 376 | span.black { color: black; } |
| 377 | span.blue { color: blue; } |
| 378 | span.fuchsia { color: fuchsia; } |
| 379 | span.gray { color: gray; } |
| 380 | span.green { color: green; } |
| 381 | span.lime { color: lime; } |
| 382 | span.maroon { color: maroon; } |
| 383 | span.navy { color: navy; } |
| 384 | span.olive { color: olive; } |
| 385 | span.purple { color: purple; } |
| 386 | span.red { color: red; } |
| 387 | span.silver { color: silver; } |
| 388 | span.teal { color: teal; } |
| 389 | span.white { color: white; } |
| 390 | span.yellow { color: yellow; } |
| 391 | |
| 392 | span.aqua-background { background: aqua; } |
| 393 | span.black-background { background: black; } |
| 394 | span.blue-background { background: blue; } |
| 395 | span.fuchsia-background { background: fuchsia; } |
| 396 | span.gray-background { background: gray; } |
| 397 | span.green-background { background: green; } |
| 398 | span.lime-background { background: lime; } |
| 399 | span.maroon-background { background: maroon; } |
| 400 | span.navy-background { background: navy; } |
| 401 | span.olive-background { background: olive; } |
| 402 | span.purple-background { background: purple; } |
| 403 | span.red-background { background: red; } |
| 404 | span.silver-background { background: silver; } |
| 405 | span.teal-background { background: teal; } |
| 406 | span.white-background { background: white; } |
| 407 | span.yellow-background { background: yellow; } |
| 408 | |
| 409 | span.big { font-size: 2em; } |
| 410 | span.small { font-size: 0.6em; } |
| 411 | |
| 412 | span.underline { text-decoration: underline; } |
| 413 | span.overline { text-decoration: overline; } |
| 414 | span.line-through { text-decoration: line-through; } |
| 415 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 416 | div.unbreakable { page-break-inside: avoid; } |
| 417 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 418 | |
| 419 | /* |
| 420 | * xhtml11 specific |
| 421 | * |
| 422 | * */ |
| 423 | |
| 424 | div.tableblock { |
| 425 | margin-top: 1.0em; |
| 426 | margin-bottom: 1.5em; |
| 427 | } |
| 428 | div.tableblock > table { |
| 429 | border: 3px solid #527bbd; |
| 430 | } |
| 431 | thead, p.table.header { |
| 432 | font-weight: bold; |
| 433 | color: #527bbd; |
| 434 | } |
| 435 | p.table { |
| 436 | margin-top: 0; |
| 437 | } |
| 438 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 439 | div.tableblock > table[frame="void"] { |
| 440 | border-style: none; |
| 441 | } |
| 442 | div.tableblock > table[frame="hsides"] { |
| 443 | border-left-style: none; |
| 444 | border-right-style: none; |
| 445 | } |
| 446 | div.tableblock > table[frame="vsides"] { |
| 447 | border-top-style: none; |
| 448 | border-bottom-style: none; |
| 449 | } |
| 450 | |
| 451 | |
| 452 | /* |
| 453 | * html5 specific |
| 454 | * |
| 455 | * */ |
| 456 | |
| 457 | table.tableblock { |
| 458 | margin-top: 1.0em; |
| 459 | margin-bottom: 1.5em; |
| 460 | } |
| 461 | thead, p.tableblock.header { |
| 462 | font-weight: bold; |
| 463 | color: #527bbd; |
| 464 | } |
| 465 | p.tableblock { |
| 466 | margin-top: 0; |
| 467 | } |
| 468 | table.tableblock { |
| 469 | border-width: 3px; |
| 470 | border-spacing: 0px; |
| 471 | border-style: solid; |
| 472 | border-color: #527bbd; |
| 473 | border-collapse: collapse; |
| 474 | } |
| 475 | th.tableblock, td.tableblock { |
| 476 | border-width: 1px; |
| 477 | padding: 4px; |
| 478 | border-style: solid; |
| 479 | border-color: #527bbd; |
| 480 | } |
| 481 | |
| 482 | table.tableblock.frame-topbot { |
| 483 | border-left-style: hidden; |
| 484 | border-right-style: hidden; |
| 485 | } |
| 486 | table.tableblock.frame-sides { |
| 487 | border-top-style: hidden; |
| 488 | border-bottom-style: hidden; |
| 489 | } |
| 490 | table.tableblock.frame-none { |
| 491 | border-style: hidden; |
| 492 | } |
| 493 | |
| 494 | th.tableblock.halign-left, td.tableblock.halign-left { |
| 495 | text-align: left; |
| 496 | } |
| 497 | th.tableblock.halign-center, td.tableblock.halign-center { |
| 498 | text-align: center; |
| 499 | } |
| 500 | th.tableblock.halign-right, td.tableblock.halign-right { |
| 501 | text-align: right; |
| 502 | } |
| 503 | |
| 504 | th.tableblock.valign-top, td.tableblock.valign-top { |
| 505 | vertical-align: top; |
| 506 | } |
| 507 | th.tableblock.valign-middle, td.tableblock.valign-middle { |
| 508 | vertical-align: middle; |
| 509 | } |
| 510 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { |
| 511 | vertical-align: bottom; |
| 512 | } |
| 513 | |
| 514 | |
| 515 | /* |
| 516 | * manpage specific |
| 517 | * |
| 518 | * */ |
| 519 | |
| 520 | body.manpage h1 { |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 521 | padding-top: 0.5em; |
| 522 | padding-bottom: 0.5em; |
| 523 | border-top: 2px solid silver; |
| 524 | border-bottom: 2px solid silver; |
| 525 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 526 | body.manpage h2 { |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 527 | border-style: none; |
| 528 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 529 | body.manpage div.sectionbody { |
| 530 | margin-left: 3em; |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 531 | } |
| 532 | |
| 533 | @media print { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 534 | body.manpage div#toc { display: none; } |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 535 | } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 536 | |
| 537 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 538 | </style> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 539 | <script type="text/javascript"> |
| 540 | /*<![CDATA[*/ |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 541 | var asciidoc = { // Namespace. |
| 542 | |
| 543 | ///////////////////////////////////////////////////////////////////// |
| 544 | // Table Of Contents generator |
| 545 | ///////////////////////////////////////////////////////////////////// |
| 546 | |
| 547 | /* Author: Mihai Bazon, September 2002 |
| 548 | * http://students.infoiasi.ro/~mishoo |
| 549 | * |
| 550 | * Table Of Content generator |
| 551 | * Version: 0.4 |
| 552 | * |
| 553 | * Feel free to use this script under the terms of the GNU General Public |
| 554 | * License, as long as you do not remove or alter this notice. |
| 555 | */ |
| 556 | |
| 557 | /* modified by Troy D. Hanson, September 2006. License: GPL */ |
| 558 | /* modified by Stuart Rackham, 2006, 2009. License: GPL */ |
| 559 | |
| 560 | // toclevels = 1..4. |
| 561 | toc: function (toclevels) { |
| 562 | |
| 563 | function getText(el) { |
| 564 | var text = ""; |
| 565 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 566 | if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. |
| 567 | text += i.data; |
| 568 | else if (i.firstChild != null) |
| 569 | text += getText(i); |
| 570 | } |
| 571 | return text; |
| 572 | } |
| 573 | |
| 574 | function TocEntry(el, text, toclevel) { |
| 575 | this.element = el; |
| 576 | this.text = text; |
| 577 | this.toclevel = toclevel; |
| 578 | } |
| 579 | |
| 580 | function tocEntries(el, toclevels) { |
| 581 | var result = new Array; |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 582 | var re = new RegExp('[hH]([1-'+(toclevels+1)+'])'); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 583 | // Function that scans the DOM tree for header elements (the DOM2 |
| 584 | // nodeIterator API would be a better technique but not supported by all |
| 585 | // browsers). |
| 586 | var iterate = function (el) { |
| 587 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 588 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 589 | var mo = re.exec(i.tagName); |
| 590 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 591 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 592 | } |
| 593 | iterate(i); |
| 594 | } |
| 595 | } |
| 596 | } |
| 597 | iterate(el); |
| 598 | return result; |
| 599 | } |
| 600 | |
| 601 | var toc = document.getElementById("toc"); |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 602 | if (!toc) { |
| 603 | return; |
| 604 | } |
| 605 | |
| 606 | // Delete existing TOC entries in case we're reloading the TOC. |
| 607 | var tocEntriesToRemove = []; |
| 608 | var i; |
| 609 | for (i = 0; i < toc.childNodes.length; i++) { |
| 610 | var entry = toc.childNodes[i]; |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 611 | if (entry.nodeName.toLowerCase() == 'div' |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 612 | && entry.getAttribute("class") |
| 613 | && entry.getAttribute("class").match(/^toclevel/)) |
| 614 | tocEntriesToRemove.push(entry); |
| 615 | } |
| 616 | for (i = 0; i < tocEntriesToRemove.length; i++) { |
| 617 | toc.removeChild(tocEntriesToRemove[i]); |
| 618 | } |
| 619 | |
| 620 | // Rebuild TOC entries. |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 621 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 622 | for (var i = 0; i < entries.length; ++i) { |
| 623 | var entry = entries[i]; |
| 624 | if (entry.element.id == "") |
| 625 | entry.element.id = "_toc_" + i; |
| 626 | var a = document.createElement("a"); |
| 627 | a.href = "#" + entry.element.id; |
| 628 | a.appendChild(document.createTextNode(entry.text)); |
| 629 | var div = document.createElement("div"); |
| 630 | div.appendChild(a); |
| 631 | div.className = "toclevel" + entry.toclevel; |
| 632 | toc.appendChild(div); |
| 633 | } |
| 634 | if (entries.length == 0) |
| 635 | toc.parentNode.removeChild(toc); |
| 636 | }, |
| 637 | |
| 638 | |
| 639 | ///////////////////////////////////////////////////////////////////// |
| 640 | // Footnotes generator |
| 641 | ///////////////////////////////////////////////////////////////////// |
| 642 | |
| 643 | /* Based on footnote generation code from: |
| 644 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 645 | */ |
| 646 | |
| 647 | footnotes: function () { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 648 | // Delete existing footnote entries in case we're reloading the footnodes. |
| 649 | var i; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 650 | var noteholder = document.getElementById("footnotes"); |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 651 | if (!noteholder) { |
| 652 | return; |
| 653 | } |
| 654 | var entriesToRemove = []; |
| 655 | for (i = 0; i < noteholder.childNodes.length; i++) { |
| 656 | var entry = noteholder.childNodes[i]; |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 657 | if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 658 | entriesToRemove.push(entry); |
| 659 | } |
| 660 | for (i = 0; i < entriesToRemove.length; i++) { |
| 661 | noteholder.removeChild(entriesToRemove[i]); |
| 662 | } |
| 663 | |
| 664 | // Rebuild footnote entries. |
| 665 | var cont = document.getElementById("content"); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 666 | var spans = cont.getElementsByTagName("span"); |
| 667 | var refs = {}; |
| 668 | var n = 0; |
| 669 | for (i=0; i<spans.length; i++) { |
| 670 | if (spans[i].className == "footnote") { |
| 671 | n++; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 672 | var note = spans[i].getAttribute("data-note"); |
| 673 | if (!note) { |
| 674 | // Use [\s\S] in place of . so multi-line matches work. |
| 675 | // Because JavaScript has no s (dotall) regex flag. |
| 676 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 677 | spans[i].innerHTML = |
| 678 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 679 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 680 | spans[i].setAttribute("data-note", note); |
| 681 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 682 | noteholder.innerHTML += |
| 683 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 684 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 685 | n + "</a>. " + note + "</div>"; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 686 | var id =spans[i].getAttribute("id"); |
| 687 | if (id != null) refs["#"+id] = n; |
| 688 | } |
| 689 | } |
| 690 | if (n == 0) |
| 691 | noteholder.parentNode.removeChild(noteholder); |
| 692 | else { |
| 693 | // Process footnoterefs. |
| 694 | for (i=0; i<spans.length; i++) { |
| 695 | if (spans[i].className == "footnoteref") { |
| 696 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 697 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 698 | n = refs[href]; |
| 699 | spans[i].innerHTML = |
| 700 | "[<a href='#_footnote_" + n + |
| 701 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 702 | } |
| 703 | } |
| 704 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 705 | }, |
| 706 | |
| 707 | install: function(toclevels) { |
| 708 | var timerId; |
| 709 | |
| 710 | function reinstall() { |
| 711 | asciidoc.footnotes(); |
| 712 | if (toclevels) { |
| 713 | asciidoc.toc(toclevels); |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | function reinstallAndRemoveTimer() { |
| 718 | clearInterval(timerId); |
| 719 | reinstall(); |
| 720 | } |
| 721 | |
| 722 | timerId = setInterval(reinstall, 500); |
| 723 | if (document.addEventListener) |
| 724 | document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); |
| 725 | else |
| 726 | window.onload = reinstallAndRemoveTimer; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 727 | } |
| 728 | |
| 729 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 730 | asciidoc.install(); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 731 | /*]]>*/ |
| 732 | </script> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 733 | </head> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 734 | <body class="manpage"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 735 | <div id="header"> |
| 736 | <h1> |
| 737 | git-add(1) Manual Page |
| 738 | </h1> |
| 739 | <h2>NAME</h2> |
| 740 | <div class="sectionbody"> |
| 741 | <p>git-add - |
Junio C Hamano | 4cd1c0e | 2007-08-06 04:39:14 | [diff] [blame] | 742 | Add file contents to the index |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 743 | </p> |
| 744 | </div> |
| 745 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 746 | <div id="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 747 | <div class="sect1"> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 748 | <h2 id="_synopsis">SYNOPSIS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 749 | <div class="sectionbody"> |
Junio C Hamano | 8b8b0f2 | 2007-08-26 22:10:26 | [diff] [blame] | 750 | <div class="verseblock"> |
Junio C Hamano | e8acc8e | 2015-01-14 22:01:34 | [diff] [blame] | 751 | <pre class="content"><em>git add</em> [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p] |
Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 752 | [--edit | -e] [--[no-]all | --[no-]ignore-removal | [--update | -u]] |
| 753 | [--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] |
| 754 | [--] [<pathspec>…]</pre> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 755 | <div class="attribution"> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 756 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 757 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 758 | </div> |
| 759 | <div class="sect1"> |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 760 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 761 | <div class="sectionbody"> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 762 | <div class="paragraph"><p>This command updates the index using the current content found in |
Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 763 | the working tree, to prepare the content staged for the next commit. |
| 764 | It typically adds the current content of existing paths as a whole, |
| 765 | but with some options it can also be used to add content with |
| 766 | only part of the changes made to the working tree files applied, or |
| 767 | remove paths that do not exist in the working tree anymore.</p></div> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 768 | <div class="paragraph"><p>The "index" holds a snapshot of the content of the working tree, and it |
Junio C Hamano | 4cd1c0e | 2007-08-06 04:39:14 | [diff] [blame] | 769 | is this snapshot that is taken as the contents of the next commit. Thus |
Junio C Hamano | ffe10ca | 2016-02-04 00:44:23 | [diff] [blame] | 770 | after making any changes to the working tree, and before running |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 771 | the commit command, you must use the <code>add</code> command to add any new or |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 772 | modified files to the index.</p></div> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 773 | <div class="paragraph"><p>This command can be performed multiple times before a commit. It only |
Junio C Hamano | 4cd1c0e | 2007-08-06 04:39:14 | [diff] [blame] | 774 | adds the content of the specified file(s) at the time the add command is |
| 775 | run; if you want subsequent changes included in the next commit, then |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 776 | you must run <code>git add</code> again to add the new content to the index.</p></div> |
| 777 | <div class="paragraph"><p>The <code>git status</code> command can be used to obtain a summary of which |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 778 | files have changes that are staged for the next commit.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 779 | <div class="paragraph"><p>The <code>git add</code> command will not add ignored files by default. If any |
| 780 | ignored files were explicitly specified on the command line, <code>git add</code> |
Junio C Hamano | 3c1f2c7 | 2007-08-17 07:48:05 | [diff] [blame] | 781 | will fail with a list of ignored files. Ignored files reached by |
Junio C Hamano | 7d9e9bd | 2007-08-29 07:31:47 | [diff] [blame] | 782 | directory recursion or filename globbing performed by Git (quote your |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 783 | globs before the shell) will be silently ignored. The <em>git add</em> command can |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 784 | be used to add ignored files with the <code>-f</code> (force) option.</p></div> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 785 | <div class="paragraph"><p>Please see <a href="git-commit.html">git-commit(1)</a> for alternative ways to add content to a |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 786 | commit.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 787 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 788 | </div> |
| 789 | <div class="sect1"> |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 790 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 791 | <div class="sectionbody"> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 792 | <div class="dlist"><dl> |
| 793 | <dt class="hdlist1"> |
Junio C Hamano | bca4cd6 | 2013-02-13 00:01:02 | [diff] [blame] | 794 | <pathspec>… |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 795 | </dt> |
| 796 | <dd> |
| 797 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 798 | Files to add content from. Fileglobs (e.g. <code>*.c</code>) can |
Junio C Hamano | 3d2adc7 | 2006-12-26 03:21:45 | [diff] [blame] | 799 | be given to add all matching files. Also a |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 800 | leading directory name (e.g. <code>dir</code> to add <code>dir/file1</code> |
| 801 | and <code>dir/file2</code>) can be given to update the index to |
Junio C Hamano | 1d669b8 | 2014-03-11 21:36:00 | [diff] [blame] | 802 | match the current state of the directory as a whole (e.g. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 803 | specifying <code>dir</code> will record not just a file <code>dir/file1</code> |
| 804 | modified in the working tree, a file <code>dir/file2</code> added to |
| 805 | the working tree, but also a file <code>dir/file3</code> removed from |
Junio C Hamano | 1d669b8 | 2014-03-11 21:36:00 | [diff] [blame] | 806 | the working tree. Note that older versions of Git used |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 807 | to ignore removed files; use <code>--no-all</code> option if you want |
Junio C Hamano | 1d669b8 | 2014-03-11 21:36:00 | [diff] [blame] | 808 | to add modified or new files but ignore removed ones. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 809 | </p> |
| 810 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 811 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 812 | -n |
| 813 | </dt> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 814 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 815 | --dry-run |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 816 | </dt> |
| 817 | <dd> |
| 818 | <p> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 819 | Don’t actually add the file(s), just show if they exist and/or will |
Junio C Hamano | afabd32 | 2010-07-19 20:26:15 | [diff] [blame] | 820 | be ignored. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 821 | </p> |
| 822 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 823 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 824 | -v |
| 825 | </dt> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 826 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 827 | --verbose |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 828 | </dt> |
| 829 | <dd> |
| 830 | <p> |
| 831 | Be verbose. |
| 832 | </p> |
| 833 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 834 | <dt class="hdlist1"> |
Junio C Hamano | 3d2adc7 | 2006-12-26 03:21:45 | [diff] [blame] | 835 | -f |
| 836 | </dt> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 837 | <dt class="hdlist1"> |
Junio C Hamano | 00e884a | 2008-06-15 05:10:38 | [diff] [blame] | 838 | --force |
| 839 | </dt> |
Junio C Hamano | 3d2adc7 | 2006-12-26 03:21:45 | [diff] [blame] | 840 | <dd> |
| 841 | <p> |
| 842 | Allow adding otherwise ignored files. |
| 843 | </p> |
| 844 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 845 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 846 | -i |
| 847 | </dt> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 848 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 849 | --interactive |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 850 | </dt> |
| 851 | <dd> |
| 852 | <p> |
| 853 | Add modified contents in the working tree interactively to |
Junio C Hamano | e0facb9 | 2007-12-05 10:59:48 | [diff] [blame] | 854 | the index. Optional path arguments may be supplied to limit |
| 855 | operation to a subset of the working tree. See “Interactive |
| 856 | mode” for details. |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 857 | </p> |
| 858 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 859 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 860 | -p |
| 861 | </dt> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 862 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 863 | --patch |
Junio C Hamano | 8d1e471 | 2007-12-11 08:54:21 | [diff] [blame] | 864 | </dt> |
| 865 | <dd> |
| 866 | <p> |
Junio C Hamano | 7df6dcf | 2009-09-13 09:51:17 | [diff] [blame] | 867 | Interactively choose hunks of patch between the index and the |
| 868 | work tree and add them to the index. This gives the user a chance |
| 869 | to review the difference before adding modified contents to the |
| 870 | index. |
Junio C Hamano | 8d1e471 | 2007-12-11 08:54:21 | [diff] [blame] | 871 | </p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 872 | <div class="paragraph"><p>This effectively runs <code>add --interactive</code>, but bypasses the |
| 873 | initial command menu and directly jumps to the <code>patch</code> subcommand. |
Junio C Hamano | e1b2683 | 2009-11-15 10:02:56 | [diff] [blame] | 874 | See “Interactive mode” for details.</p></div> |
Junio C Hamano | 8d1e471 | 2007-12-11 08:54:21 | [diff] [blame] | 875 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 876 | <dt class="hdlist1"> |
Junio C Hamano | 1dbca52 | 2015-05-22 20:48:55 | [diff] [blame] | 877 | -e |
| 878 | </dt> |
| 879 | <dt class="hdlist1"> |
| 880 | --edit |
Junio C Hamano | 52ba295 | 2009-05-18 17:43:02 | [diff] [blame] | 881 | </dt> |
| 882 | <dd> |
| 883 | <p> |
| 884 | Open the diff vs. the index in an editor and let the user |
| 885 | edit it. After the editor was closed, adjust the hunk headers |
| 886 | and apply the patch to the index. |
| 887 | </p> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 888 | <div class="paragraph"><p>The intent of this option is to pick and choose lines of the patch to |
| 889 | apply, or even to modify the contents of lines to be staged. This can be |
| 890 | quicker and more flexible than using the interactive hunk selector. |
| 891 | However, it is easy to confuse oneself and create a patch that does not |
| 892 | apply to the index. See EDITING PATCHES below.</p></div> |
Junio C Hamano | 52ba295 | 2009-05-18 17:43:02 | [diff] [blame] | 893 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 894 | <dt class="hdlist1"> |
Junio C Hamano | 3d30fd5 | 2007-05-08 00:32:53 | [diff] [blame] | 895 | -u |
| 896 | </dt> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 897 | <dt class="hdlist1"> |
Junio C Hamano | 00e884a | 2008-06-15 05:10:38 | [diff] [blame] | 898 | --update |
| 899 | </dt> |
Junio C Hamano | 3d30fd5 | 2007-05-08 00:32:53 | [diff] [blame] | 900 | <dd> |
| 901 | <p> |
Junio C Hamano | f66c463 | 2013-03-11 20:54:25 | [diff] [blame] | 902 | Update the index just where it already has an entry matching |
| 903 | <pathspec>. This removes as well as modifies index entries to |
| 904 | match the working tree, but adds no new files. |
Junio C Hamano | 3d30fd5 | 2007-05-08 00:32:53 | [diff] [blame] | 905 | </p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 906 | <div class="paragraph"><p>If no <pathspec> is given when <code>-u</code> option is used, all |
Junio C Hamano | 1d669b8 | 2014-03-11 21:36:00 | [diff] [blame] | 907 | tracked files in the entire working tree are updated (old versions |
| 908 | of Git used to limit the update to the current directory and its |
| 909 | subdirectories).</p></div> |
Junio C Hamano | 3d30fd5 | 2007-05-08 00:32:53 | [diff] [blame] | 910 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 911 | <dt class="hdlist1"> |
Junio C Hamano | 5ba2c22 | 2008-07-21 04:33:46 | [diff] [blame] | 912 | -A |
| 913 | </dt> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 914 | <dt class="hdlist1"> |
Junio C Hamano | 5ba2c22 | 2008-07-21 04:33:46 | [diff] [blame] | 915 | --all |
| 916 | </dt> |
Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 917 | <dt class="hdlist1"> |
| 918 | --no-ignore-removal |
| 919 | </dt> |
Junio C Hamano | 5ba2c22 | 2008-07-21 04:33:46 | [diff] [blame] | 920 | <dd> |
| 921 | <p> |
Junio C Hamano | f66c463 | 2013-03-11 20:54:25 | [diff] [blame] | 922 | Update the index not only where the working tree has a file |
| 923 | matching <pathspec> but also where the index already has an |
| 924 | entry. This adds, modifies, and removes index entries to |
| 925 | match the working tree. |
Junio C Hamano | 5ba2c22 | 2008-07-21 04:33:46 | [diff] [blame] | 926 | </p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 927 | <div class="paragraph"><p>If no <pathspec> is given when <code>-A</code> option is used, all |
Junio C Hamano | 1d669b8 | 2014-03-11 21:36:00 | [diff] [blame] | 928 | files in the entire working tree are updated (old versions |
| 929 | of Git used to limit the update to the current directory and its |
| 930 | subdirectories).</p></div> |
Junio C Hamano | 5ba2c22 | 2008-07-21 04:33:46 | [diff] [blame] | 931 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 932 | <dt class="hdlist1"> |
Junio C Hamano | c79bc67 | 2013-04-22 19:12:47 | [diff] [blame] | 933 | --no-all |
| 934 | </dt> |
Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 935 | <dt class="hdlist1"> |
| 936 | --ignore-removal |
| 937 | </dt> |
Junio C Hamano | c79bc67 | 2013-04-22 19:12:47 | [diff] [blame] | 938 | <dd> |
| 939 | <p> |
| 940 | Update the index by adding new files that are unknown to the |
| 941 | index and files modified in the working tree, but ignore |
| 942 | files that have been removed from the working tree. This |
| 943 | option is a no-op when no <pathspec> is used. |
| 944 | </p> |
Junio C Hamano | 1d669b8 | 2014-03-11 21:36:00 | [diff] [blame] | 945 | <div class="paragraph"><p>This option is primarily to help users who are used to older |
| 946 | versions of Git, whose "git add <pathspec>…" was a synonym |
| 947 | for "git add --no-all <pathspec>…", i.e. ignored removed files.</p></div> |
Junio C Hamano | c79bc67 | 2013-04-22 19:12:47 | [diff] [blame] | 948 | </dd> |
| 949 | <dt class="hdlist1"> |
Junio C Hamano | 845880c | 2008-10-21 19:04:45 | [diff] [blame] | 950 | -N |
| 951 | </dt> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 952 | <dt class="hdlist1"> |
Junio C Hamano | 845880c | 2008-10-21 19:04:45 | [diff] [blame] | 953 | --intent-to-add |
| 954 | </dt> |
| 955 | <dd> |
| 956 | <p> |
| 957 | Record only the fact that the path will be added later. An entry |
| 958 | for the path is placed in the index with no content. This is |
| 959 | useful for, among other things, showing the unstaged content of |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 960 | such files with <code>git diff</code> and committing them with <code>git commit |
| 961 | -a</code>. |
Junio C Hamano | 845880c | 2008-10-21 19:04:45 | [diff] [blame] | 962 | </p> |
| 963 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 964 | <dt class="hdlist1"> |
Junio C Hamano | 024b6c6 | 2007-08-14 09:43:08 | [diff] [blame] | 965 | --refresh |
| 966 | </dt> |
| 967 | <dd> |
| 968 | <p> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 969 | Don’t add the file(s), but only refresh their stat() |
Junio C Hamano | 024b6c6 | 2007-08-14 09:43:08 | [diff] [blame] | 970 | information in the index. |
| 971 | </p> |
| 972 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 973 | <dt class="hdlist1"> |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 974 | --ignore-errors |
| 975 | </dt> |
| 976 | <dd> |
| 977 | <p> |
| 978 | If some files could not be added because of errors indexing |
| 979 | them, do not abort the operation, but continue adding the |
| 980 | others. The command shall still exit with non-zero status. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 981 | The configuration variable <code>add.ignoreErrors</code> can be set to |
Junio C Hamano | b77f819 | 2011-05-05 01:30:38 | [diff] [blame] | 982 | true to make this the default behaviour. |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 983 | </p> |
| 984 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 985 | <dt class="hdlist1"> |
Junio C Hamano | afabd32 | 2010-07-19 20:26:15 | [diff] [blame] | 986 | --ignore-missing |
| 987 | </dt> |
| 988 | <dd> |
| 989 | <p> |
| 990 | This option can only be used together with --dry-run. By using |
| 991 | this option the user can check if any of the given files would |
| 992 | be ignored, no matter if they are already present in the work |
| 993 | tree or not. |
| 994 | </p> |
| 995 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 996 | <dt class="hdlist1"> |
Junio C Hamano | 1bb569e | 2006-05-05 23:14:25 | [diff] [blame] | 997 | -- |
Junio C Hamano | 7e9f6b7 | 2006-02-22 10:44:55 | [diff] [blame] | 998 | </dt> |
| 999 | <dd> |
| 1000 | <p> |
| 1001 | This option can be used to separate command-line options from |
| 1002 | the list of files, (useful when filenames might be mistaken |
| 1003 | for command-line options). |
| 1004 | </p> |
| 1005 | </dd> |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1006 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1007 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1008 | </div> |
| 1009 | <div class="sect1"> |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1010 | <h2 id="_configuration">Configuration</h2> |
Junio C Hamano | 9fbd4f7 | 2007-05-18 15:54:37 | [diff] [blame] | 1011 | <div class="sectionbody"> |
Junio C Hamano | 322c624 | 2015-03-23 21:32:46 | [diff] [blame] | 1012 | <div class="paragraph"><p>The optional configuration variable <code>core.excludesFile</code> indicates a path to a |
Junio C Hamano | 9fbd4f7 | 2007-05-18 15:54:37 | [diff] [blame] | 1013 | file containing patterns of file names to exclude from git-add, similar to |
| 1014 | $GIT_DIR/info/exclude. Patterns in the exclude file are used in addition to |
Junio C Hamano | 4f07aec | 2012-09-25 19:08:44 | [diff] [blame] | 1015 | those in info/exclude. See <a href="gitignore.html">gitignore(5)</a>.</p></div> |
Junio C Hamano | 9fbd4f7 | 2007-05-18 15:54:37 | [diff] [blame] | 1016 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1017 | </div> |
| 1018 | <div class="sect1"> |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1019 | <h2 id="_examples">EXAMPLES</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1020 | <div class="sectionbody"> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1021 | <div class="ulist"><ul> |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1022 | <li> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1023 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1024 | Adds content from all <code>*.txt</code> files under <code>Documentation</code> directory |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1025 | and its subdirectories: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1026 | </p> |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1027 | <div class="listingblock"> |
| 1028 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1029 | <pre><code>$ git add Documentation/\*.txt</code></pre> |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1030 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1031 | <div class="paragraph"><p>Note that the asterisk <code>*</code> is quoted from the shell in this |
Junio C Hamano | f8a7922 | 2009-03-01 08:02:50 | [diff] [blame] | 1032 | example; this lets the command include the files from |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1033 | subdirectories of <code>Documentation/</code> directory.</p></div> |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1034 | </li> |
| 1035 | <li> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1036 | <p> |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1037 | Considers adding content from all git-*.sh scripts: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1038 | </p> |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1039 | <div class="listingblock"> |
| 1040 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1041 | <pre><code>$ git add git-*.sh</code></pre> |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1042 | </div></div> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1043 | <div class="paragraph"><p>Because this example lets the shell expand the asterisk (i.e. you are |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1044 | listing the files explicitly), it does not consider |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1045 | <code>subdir/git-foo.sh</code>.</p></div> |
Junio C Hamano | 6d76d61 | 2008-05-09 05:46:08 | [diff] [blame] | 1046 | </li> |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1047 | </ul></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1048 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1049 | </div> |
| 1050 | <div class="sect1"> |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1051 | <h2 id="_interactive_mode">Interactive mode</h2> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1052 | <div class="sectionbody"> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1053 | <div class="paragraph"><p>When the command enters the interactive mode, it shows the |
Junio C Hamano | f9771f6 | 2007-01-17 17:42:30 | [diff] [blame] | 1054 | output of the <em>status</em> subcommand, and then goes into its |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1055 | interactive command loop.</p></div> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1056 | <div class="paragraph"><p>The command loop shows the list of subcommands available, and |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1057 | gives a prompt "What now> ". In general, when the prompt ends |
| 1058 | with a single <em>></em>, you can pick only one of the choices given |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1059 | and type return, like this:</p></div> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1060 | <div class="listingblock"> |
| 1061 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1062 | <pre><code> *** Commands *** |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1063 | 1: status 2: update 3: revert 4: add untracked |
| 1064 | 5: patch 6: diff 7: quit 8: help |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1065 | What now> 1</code></pre> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1066 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1067 | <div class="paragraph"><p>You also could say <code>s</code> or <code>sta</code> or <code>status</code> above as long as the |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1068 | choice is unique.</p></div> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1069 | <div class="paragraph"><p>The main command loop has 6 subcommands (plus help and quit).</p></div> |
| 1070 | <div class="dlist"><dl> |
| 1071 | <dt class="hdlist1"> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1072 | status |
| 1073 | </dt> |
| 1074 | <dd> |
| 1075 | <p> |
| 1076 | This shows the change between HEAD and index (i.e. what will be |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1077 | committed if you say <code>git commit</code>), and between index and |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1078 | working tree files (i.e. what you could stage further before |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1079 | <code>git commit</code> using <code>git add</code>) for each path. A sample output |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1080 | looks like this: |
| 1081 | </p> |
| 1082 | <div class="listingblock"> |
| 1083 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1084 | <pre><code> staged unstaged path |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1085 | 1: binary nothing foo.png |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1086 | 2: +403/-35 +1/-1 git-add--interactive.perl</code></pre> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1087 | </div></div> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1088 | <div class="paragraph"><p>It shows that foo.png has differences from HEAD (but that is |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1089 | binary so line count cannot be shown) and there is no |
| 1090 | difference between indexed copy and the working tree |
| 1091 | version (if the working tree version were also different, |
| 1092 | <em>binary</em> would have been shown in place of <em>nothing</em>). The |
Junio C Hamano | 2db3e75 | 2010-09-03 21:33:06 | [diff] [blame] | 1093 | other file, git-add--interactive.perl, has 403 lines added |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1094 | and 35 lines deleted if you commit what is in the index, but |
| 1095 | working tree file has further modifications (one addition and |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1096 | one deletion).</p></div> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1097 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1098 | <dt class="hdlist1"> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1099 | update |
| 1100 | </dt> |
| 1101 | <dd> |
| 1102 | <p> |
Junio C Hamano | f8a7922 | 2009-03-01 08:02:50 | [diff] [blame] | 1103 | This shows the status information and issues an "Update>>" |
| 1104 | prompt. When the prompt ends with double <em>>></em>, you can |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1105 | make more than one selection, concatenated with whitespace or |
| 1106 | comma. Also you can say ranges. E.g. "2-5 7,9" to choose |
Junio C Hamano | 38ddcce | 2008-07-15 15:49:03 | [diff] [blame] | 1107 | 2,3,4,5,7,9 from the list. If the second number in a range is |
| 1108 | omitted, all remaining patches are taken. E.g. "7-" to choose |
| 1109 | 7,8,9 from the list. You can say <em>*</em> to choose everything. |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1110 | </p> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1111 | <div class="paragraph"><p>What you chose are then highlighted with <em>*</em>, |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1112 | like this:</p></div> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1113 | <div class="listingblock"> |
| 1114 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1115 | <pre><code> staged unstaged path |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1116 | 1: binary nothing foo.png |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1117 | * 2: +403/-35 +1/-1 git-add--interactive.perl</code></pre> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1118 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1119 | <div class="paragraph"><p>To remove selection, prefix the input with <code>-</code> |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1120 | like this:</p></div> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1121 | <div class="listingblock"> |
| 1122 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1123 | <pre><code>Update>> -2</code></pre> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1124 | </div></div> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1125 | <div class="paragraph"><p>After making the selection, answer with an empty line to stage the |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1126 | contents of working tree files for selected paths in the index.</p></div> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1127 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1128 | <dt class="hdlist1"> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1129 | revert |
| 1130 | </dt> |
| 1131 | <dd> |
| 1132 | <p> |
| 1133 | This has a very similar UI to <em>update</em>, and the staged |
| 1134 | information for selected paths are reverted to that of the |
| 1135 | HEAD version. Reverting new paths makes them untracked. |
| 1136 | </p> |
| 1137 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1138 | <dt class="hdlist1"> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1139 | add untracked |
| 1140 | </dt> |
| 1141 | <dd> |
| 1142 | <p> |
| 1143 | This has a very similar UI to <em>update</em> and |
| 1144 | <em>revert</em>, and lets you add untracked paths to the index. |
| 1145 | </p> |
| 1146 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1147 | <dt class="hdlist1"> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1148 | patch |
| 1149 | </dt> |
| 1150 | <dd> |
| 1151 | <p> |
Junio C Hamano | f8a7922 | 2009-03-01 08:02:50 | [diff] [blame] | 1152 | This lets you choose one path out of a <em>status</em> like selection. |
| 1153 | After choosing the path, it presents the diff between the index |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1154 | and the working tree file and asks you if you want to stage |
Junio C Hamano | 9eb5835 | 2011-05-11 20:09:24 | [diff] [blame] | 1155 | the change of each hunk. You can select one of the following |
| 1156 | options and type return: |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1157 | </p> |
| 1158 | <div class="literalblock"> |
| 1159 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1160 | <pre><code>y - stage this hunk |
Junio C Hamano | 8760ea6 | 2008-03-14 08:58:45 | [diff] [blame] | 1161 | n - do not stage this hunk |
Junio C Hamano | d75148a | 2014-04-08 19:48:38 | [diff] [blame] | 1162 | q - quit; do not stage this hunk or any of the remaining ones |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 1163 | a - stage this hunk and all later hunks in the file |
Junio C Hamano | d75148a | 2014-04-08 19:48:38 | [diff] [blame] | 1164 | d - do not stage this hunk or any of the later hunks in the file |
Junio C Hamano | 3bd66e9 | 2009-04-18 06:17:56 | [diff] [blame] | 1165 | g - select a hunk to go to |
| 1166 | / - search for a hunk matching the given regex |
Junio C Hamano | 8760ea6 | 2008-03-14 08:58:45 | [diff] [blame] | 1167 | j - leave this hunk undecided, see next undecided hunk |
| 1168 | J - leave this hunk undecided, see next hunk |
| 1169 | k - leave this hunk undecided, see previous undecided hunk |
| 1170 | K - leave this hunk undecided, see previous hunk |
Junio C Hamano | e0facb9 | 2007-12-05 10:59:48 | [diff] [blame] | 1171 | s - split the current hunk into smaller hunks |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1172 | e - manually edit the current hunk |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1173 | ? - print help</code></pre> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1174 | </div></div> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1175 | <div class="paragraph"><p>After deciding the fate for all hunks, if there is any hunk |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1176 | that was chosen, the index is updated with the selected hunks.</p></div> |
Junio C Hamano | 9eb5835 | 2011-05-11 20:09:24 | [diff] [blame] | 1177 | <div class="paragraph"><p>You can omit having to type return here, by setting the configuration |
Junio C Hamano | 322c624 | 2015-03-23 21:32:46 | [diff] [blame] | 1178 | variable <code>interactive.singleKey</code> to <code>true</code>.</p></div> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1179 | </dd> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1180 | <dt class="hdlist1"> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1181 | diff |
| 1182 | </dt> |
| 1183 | <dd> |
| 1184 | <p> |
| 1185 | This lets you review what will be committed (i.e. between |
| 1186 | HEAD and index). |
| 1187 | </p> |
| 1188 | </dd> |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1189 | </dl></div> |
Junio C Hamano | 17bbaca | 2006-12-25 11:36:31 | [diff] [blame] | 1190 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1191 | </div> |
| 1192 | <div class="sect1"> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1193 | <h2 id="_editing_patches">EDITING PATCHES</h2> |
| 1194 | <div class="sectionbody"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1195 | <div class="paragraph"><p>Invoking <code>git add -e</code> or selecting <code>e</code> from the interactive hunk |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1196 | selector will open a patch in your editor; after the editor exits, the |
| 1197 | result is applied to the index. You are free to make arbitrary changes |
| 1198 | to the patch, but note that some changes may have confusing results, or |
| 1199 | even result in a patch that cannot be applied. If you want to abort the |
| 1200 | operation entirely (i.e., stage nothing new in the index), simply delete |
| 1201 | all lines of the patch. The list below describes some common things you |
| 1202 | may see in a patch, and which editing operations make sense on them.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1203 | <div class="openblock"> |
| 1204 | <div class="content"> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1205 | <div class="dlist"><dl> |
| 1206 | <dt class="hdlist1"> |
| 1207 | added content |
| 1208 | </dt> |
| 1209 | <dd> |
| 1210 | <p> |
| 1211 | Added content is represented by lines beginning with "+". You can |
| 1212 | prevent staging any addition lines by deleting them. |
| 1213 | </p> |
| 1214 | </dd> |
| 1215 | <dt class="hdlist1"> |
| 1216 | removed content |
| 1217 | </dt> |
| 1218 | <dd> |
| 1219 | <p> |
| 1220 | Removed content is represented by lines beginning with "-". You can |
| 1221 | prevent staging their removal by converting the "-" to a " " (space). |
| 1222 | </p> |
| 1223 | </dd> |
| 1224 | <dt class="hdlist1"> |
| 1225 | modified content |
| 1226 | </dt> |
| 1227 | <dd> |
| 1228 | <p> |
| 1229 | Modified content is represented by "-" lines (removing the old content) |
| 1230 | followed by "+" lines (adding the replacement content). You can |
| 1231 | prevent staging the modification by converting "-" lines to " ", and |
| 1232 | removing "+" lines. Beware that modifying only half of the pair is |
| 1233 | likely to introduce confusing changes to the index. |
| 1234 | </p> |
| 1235 | </dd> |
| 1236 | </dl></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1237 | </div></div> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1238 | <div class="paragraph"><p>There are also more complex operations that can be performed. But beware |
| 1239 | that because the patch is applied only to the index and not the working |
| 1240 | tree, the working tree will appear to "undo" the change in the index. |
Junio C Hamano | 7165bf7 | 2011-01-04 22:06:18 | [diff] [blame] | 1241 | For example, introducing a new line into the index that is in neither |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1242 | the HEAD nor the working tree will stage the new line for commit, but |
| 1243 | the line will appear to be reverted in the working tree.</p></div> |
| 1244 | <div class="paragraph"><p>Avoid using these constructs, or do so with extreme caution.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1245 | <div class="openblock"> |
| 1246 | <div class="content"> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1247 | <div class="dlist"><dl> |
| 1248 | <dt class="hdlist1"> |
| 1249 | removing untouched content |
| 1250 | </dt> |
| 1251 | <dd> |
| 1252 | <p> |
| 1253 | Content which does not differ between the index and working tree may be |
| 1254 | shown on context lines, beginning with a " " (space). You can stage |
| 1255 | context lines for removal by converting the space to a "-". The |
| 1256 | resulting working tree file will appear to re-add the content. |
| 1257 | </p> |
| 1258 | </dd> |
| 1259 | <dt class="hdlist1"> |
| 1260 | modifying existing content |
| 1261 | </dt> |
| 1262 | <dd> |
| 1263 | <p> |
| 1264 | One can also modify context lines by staging them for removal (by |
| 1265 | converting " " to "-") and adding a "+" line with the new content. |
| 1266 | Similarly, one can modify "+" lines for existing additions or |
| 1267 | modifications. In all cases, the new modification will appear reverted |
| 1268 | in the working tree. |
| 1269 | </p> |
| 1270 | </dd> |
| 1271 | <dt class="hdlist1"> |
| 1272 | new content |
| 1273 | </dt> |
| 1274 | <dd> |
| 1275 | <p> |
| 1276 | You may also add new content that does not exist in the patch; simply |
| 1277 | add new lines, each starting with "+". The addition will appear |
| 1278 | reverted in the working tree. |
| 1279 | </p> |
| 1280 | </dd> |
| 1281 | </dl></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1282 | </div></div> |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1283 | <div class="paragraph"><p>There are also several operations which should be avoided entirely, as |
| 1284 | they will make the patch impossible to apply:</p></div> |
| 1285 | <div class="ulist"><ul> |
| 1286 | <li> |
| 1287 | <p> |
| 1288 | adding context (" ") or removal ("-") lines |
| 1289 | </p> |
| 1290 | </li> |
| 1291 | <li> |
| 1292 | <p> |
| 1293 | deleting context or removal lines |
| 1294 | </p> |
| 1295 | </li> |
| 1296 | <li> |
| 1297 | <p> |
| 1298 | modifying the contents of context or removal lines |
| 1299 | </p> |
| 1300 | </li> |
| 1301 | </ul></div> |
| 1302 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1303 | </div> |
| 1304 | <div class="sect1"> |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1305 | <h2 id="_see_also">SEE ALSO</h2> |
Junio C Hamano | 2bb1310 | 2006-03-06 07:10:21 | [diff] [blame] | 1306 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1307 | <div class="paragraph"><p><a href="git-status.html">git-status(1)</a> |
| 1308 | <a href="git-rm.html">git-rm(1)</a> |
| 1309 | <a href="git-reset.html">git-reset(1)</a> |
| 1310 | <a href="git-mv.html">git-mv(1)</a> |
| 1311 | <a href="git-commit.html">git-commit(1)</a> |
| 1312 | <a href="git-update-index.html">git-update-index(1)</a></p></div> |
Junio C Hamano | 2bb1310 | 2006-03-06 07:10:21 | [diff] [blame] | 1313 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1314 | </div> |
| 1315 | <div class="sect1"> |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1316 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1317 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1318 | <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1319 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 1320 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1321 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 1322 | <div id="footnotes"><hr /></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1323 | <div id="footer"> |
| 1324 | <div id="footer-text"> |
Junio C Hamano | ffe10ca | 2016-02-04 00:44:23 | [diff] [blame] | 1325 | Last updated 2016-02-03 16:43:50 PST |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1326 | </div> |
| 1327 | </div> |
| 1328 | </body> |
| 1329 | </html> |