Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"/> |
| 5 | <meta http-equiv="X-UA-Compatible" content="IE=edge"/> |
| 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"/> |
| 7 | <meta name="generator" content="Asciidoctor 2.0.20"/> |
| 8 | <title>git-pull(1)</title> |
| 9 | <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"/> |
| 10 | <style> |
| 11 | /*! Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */ |
| 12 | /* Uncomment the following line when using as a custom stylesheet */ |
| 13 | /* @import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"; */ |
| 14 | html{font-family:sans-serif;-webkit-text-size-adjust:100%} |
| 15 | a{background:none} |
| 16 | a:focus{outline:thin dotted} |
| 17 | a:active,a:hover{outline:0} |
| 18 | h1{font-size:2em;margin:.67em 0} |
| 19 | b,strong{font-weight:bold} |
| 20 | abbr{font-size:.9em} |
| 21 | abbr[title]{cursor:help;border-bottom:1px dotted #dddddf;text-decoration:none} |
| 22 | dfn{font-style:italic} |
| 23 | hr{height:0} |
| 24 | mark{background:#ff0;color:#000} |
| 25 | code,kbd,pre,samp{font-family:monospace;font-size:1em} |
| 26 | pre{white-space:pre-wrap} |
| 27 | q{quotes:"\201C" "\201D" "\2018" "\2019"} |
| 28 | small{font-size:80%} |
| 29 | sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} |
| 30 | sup{top:-.5em} |
| 31 | sub{bottom:-.25em} |
| 32 | img{border:0} |
| 33 | svg:not(:root){overflow:hidden} |
| 34 | figure{margin:0} |
| 35 | audio,video{display:inline-block} |
| 36 | audio:not([controls]){display:none;height:0} |
| 37 | fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em} |
| 38 | legend{border:0;padding:0} |
| 39 | button,input,select,textarea{font-family:inherit;font-size:100%;margin:0} |
| 40 | button,input{line-height:normal} |
| 41 | button,select{text-transform:none} |
| 42 | button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer} |
| 43 | button[disabled],html input[disabled]{cursor:default} |
| 44 | input[type=checkbox],input[type=radio]{padding:0} |
| 45 | button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0} |
| 46 | textarea{overflow:auto;vertical-align:top} |
| 47 | table{border-collapse:collapse;border-spacing:0} |
| 48 | *,::before,::after{box-sizing:border-box} |
| 49 | html,body{font-size:100%} |
| 50 | body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;line-height:1;position:relative;cursor:auto;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-wrap:anywhere;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased} |
| 51 | a:hover{cursor:pointer} |
| 52 | img,object,embed{max-width:100%;height:auto} |
| 53 | object,embed{height:100%} |
| 54 | img{-ms-interpolation-mode:bicubic} |
| 55 | .left{float:left!important} |
| 56 | .right{float:right!important} |
| 57 | .text-left{text-align:left!important} |
| 58 | .text-right{text-align:right!important} |
| 59 | .text-center{text-align:center!important} |
| 60 | .text-justify{text-align:justify!important} |
| 61 | .hide{display:none} |
| 62 | img,object,svg{display:inline-block;vertical-align:middle} |
| 63 | textarea{height:auto;min-height:50px} |
| 64 | select{width:100%} |
| 65 | .subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em} |
| 66 | div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0} |
| 67 | a{color:#2156a5;text-decoration:underline;line-height:inherit} |
| 68 | a:hover,a:focus{color:#1d4b8f} |
| 69 | a img{border:0} |
| 70 | p{line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility} |
| 71 | p aside{font-size:.875em;line-height:1.35;font-style:italic} |
| 72 | h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em} |
| 73 | h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0} |
| 74 | h1{font-size:2.125em} |
| 75 | h2{font-size:1.6875em} |
| 76 | h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em} |
| 77 | h4,h5{font-size:1.125em} |
| 78 | h6{font-size:1em} |
| 79 | hr{border:solid #dddddf;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em} |
| 80 | em,i{font-style:italic;line-height:inherit} |
| 81 | strong,b{font-weight:bold;line-height:inherit} |
| 82 | small{font-size:60%;line-height:inherit} |
| 83 | code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)} |
| 84 | ul,ol,dl{line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit} |
| 85 | ul,ol{margin-left:1.5em} |
| 86 | ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0} |
| 87 | ul.circle{list-style-type:circle} |
| 88 | ul.disc{list-style-type:disc} |
| 89 | ul.square{list-style-type:square} |
| 90 | ul.circle ul:not([class]),ul.disc ul:not([class]),ul.square ul:not([class]){list-style:inherit} |
| 91 | ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0} |
| 92 | dl dt{margin-bottom:.3125em;font-weight:bold} |
| 93 | dl dd{margin-bottom:1.25em} |
| 94 | blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd} |
| 95 | blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)} |
| 96 | @media screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2} |
| 97 | h1{font-size:2.75em} |
| 98 | h2{font-size:2.3125em} |
| 99 | h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em} |
| 100 | h4{font-size:1.4375em}} |
| 101 | table{background:#fff;margin-bottom:1.25em;border:1px solid #dedede;word-wrap:normal} |
| 102 | table thead,table tfoot{background:#f7f8f7} |
| 103 | table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left} |
| 104 | table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)} |
| 105 | table tr.even,table tr.alt{background:#f8f8f7} |
| 106 | table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{line-height:1.6} |
| 107 | h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em} |
| 108 | h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400} |
| 109 | .center{margin-left:auto;margin-right:auto} |
| 110 | .stretch{width:100%} |
| 111 | .clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:" ";display:table} |
| 112 | .clearfix::after,.float-group::after{clear:both} |
| 113 | :not(pre).nobreak{word-wrap:normal} |
| 114 | :not(pre).nowrap{white-space:nowrap} |
| 115 | :not(pre).pre-wrap{white-space:pre-wrap} |
| 116 | :not(pre):not([class^=L])>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background:#f7f7f8;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed} |
| 117 | pre{color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;line-height:1.45;text-rendering:optimizeSpeed} |
| 118 | pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit} |
| 119 | pre>code{display:block} |
| 120 | pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal} |
| 121 | em em{font-style:normal} |
| 122 | strong strong{font-weight:400} |
| 123 | .keyseq{color:rgba(51,51,51,.8)} |
| 124 | kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background:#f7f7f7;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 0 rgba(0,0,0,.2),inset 0 0 0 .1em #fff;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap} |
| 125 | .keyseq kbd:first-child{margin-left:0} |
| 126 | .keyseq kbd:last-child{margin-right:0} |
| 127 | .menuseq,.menuref{color:#000} |
| 128 | .menuseq b:not(.caret),.menuref{font-weight:inherit} |
| 129 | .menuseq{word-spacing:-.02em} |
| 130 | .menuseq b.caret{font-size:1.25em;line-height:.8} |
| 131 | .menuseq i.caret{font-weight:bold;text-align:center;width:.45em} |
| 132 | b.button::before,b.button::after{position:relative;top:-1px;font-weight:400} |
| 133 | b.button::before{content:"[";padding:0 3px 0 2px} |
| 134 | b.button::after{content:"]";padding:0 2px 0 3px} |
| 135 | p a>code:hover{color:rgba(0,0,0,.9)} |
| 136 | #header,#content,#footnotes,#footer{width:100%;margin:0 auto;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em} |
| 137 | #header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:" ";display:table} |
| 138 | #header::after,#content::after,#footnotes::after,#footer::after{clear:both} |
| 139 | #content{margin-top:1.25em} |
| 140 | #content::before{content:none} |
| 141 | #header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0} |
| 142 | #header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf} |
| 143 | #header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px} |
| 144 | #header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:flex;flex-flow:row wrap} |
| 145 | #header .details span:first-child{margin-left:-.125em} |
| 146 | #header .details span.email a{color:rgba(0,0,0,.85)} |
| 147 | #header .details br{display:none} |
| 148 | #header .details br+span::before{content:"\00a0\2013\00a0"} |
| 149 | #header .details br+span.author::before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)} |
| 150 | #header .details br+span#revremark::before{content:"\00a0|\00a0"} |
| 151 | #header #revnumber{text-transform:capitalize} |
| 152 | #header #revnumber::after{content:"\00a0"} |
| 153 | #content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #dddddf;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem} |
| 154 | #toc{border-bottom:1px solid #e7e7e9;padding-bottom:.5em} |
| 155 | #toc>ul{margin-left:.125em} |
| 156 | #toc ul.sectlevel0>li>a{font-style:italic} |
| 157 | #toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0} |
| 158 | #toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none} |
| 159 | #toc li{line-height:1.3334;margin-top:.3334em} |
| 160 | #toc a{text-decoration:none} |
| 161 | #toc a:active{text-decoration:underline} |
| 162 | #toctitle{color:#7a2518;font-size:1.2em} |
| 163 | @media screen and (min-width:768px){#toctitle{font-size:1.375em} |
| 164 | body.toc2{padding-left:15em;padding-right:0} |
| 165 | #toc.toc2{margin-top:0!important;background:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto} |
| 166 | #toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em} |
| 167 | #toc.toc2>ul{font-size:.9em;margin-bottom:0} |
| 168 | #toc.toc2 ul ul{margin-left:0;padding-left:1em} |
| 169 | #toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em} |
| 170 | body.toc2.toc-right{padding-left:0;padding-right:15em} |
| 171 | body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #e7e7e9;left:auto;right:0}} |
| 172 | @media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0} |
| 173 | #toc.toc2{width:20em} |
| 174 | #toc.toc2 #toctitle{font-size:1.375em} |
| 175 | #toc.toc2>ul{font-size:.95em} |
| 176 | #toc.toc2 ul ul{padding-left:1.25em} |
| 177 | body.toc2.toc-right{padding-left:0;padding-right:20em}} |
| 178 | #content #toc{border:1px solid #e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;border-radius:4px} |
| 179 | #content #toc>:first-child{margin-top:0} |
| 180 | #content #toc>:last-child{margin-bottom:0} |
| 181 | #footer{max-width:none;background:rgba(0,0,0,.8);padding:1.25em} |
| 182 | #footer-text{color:hsla(0,0%,100%,.8);line-height:1.44} |
| 183 | #content{margin-bottom:.625em} |
| 184 | .sect1{padding-bottom:.625em} |
| 185 | @media screen and (min-width:768px){#content{margin-bottom:1.25em} |
| 186 | .sect1{padding-bottom:1.25em}} |
| 187 | .sect1:last-child{padding-bottom:0} |
| 188 | .sect1+.sect1{border-top:1px solid #e7e7e9} |
| 189 | #content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400} |
| 190 | #content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em} |
| 191 | #content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible} |
| 192 | #content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none} |
| 193 | #content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221} |
| 194 | details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em} |
| 195 | details{margin-left:1.25rem} |
| 196 | details>summary{cursor:pointer;display:block;position:relative;line-height:1.6;margin-bottom:.625rem;outline:none;-webkit-tap-highlight-color:transparent} |
| 197 | details>summary::-webkit-details-marker{display:none} |
| 198 | details>summary::before{content:"";border:solid transparent;border-left:solid;border-width:.3em 0 .3em .5em;position:absolute;top:.5em;left:-1.25rem;transform:translateX(15%)} |
| 199 | details[open]>summary::before{border:solid transparent;border-top:solid;border-width:.5em .3em 0;transform:translateY(15%)} |
| 200 | details>summary::after{content:"";width:1.25rem;height:1em;position:absolute;top:.3em;left:-1.25rem} |
| 201 | .admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic} |
| 202 | table.tableblock.fit-content>caption.title{white-space:nowrap;width:0} |
| 203 | .paragraph.lead>p,#preamble>.sectionbody>[class=paragraph]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)} |
| 204 | .admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%} |
| 205 | .admonitionblock>table td.icon{text-align:center;width:80px} |
| 206 | .admonitionblock>table td.icon img{max-width:none} |
| 207 | .admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase} |
| 208 | .admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere} |
| 209 | .admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0} |
| 210 | .exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px} |
| 211 | .sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px} |
| 212 | .sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center} |
| 213 | .exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0} |
| 214 | .exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0} |
| 215 | .literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em} |
| 216 | @media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}} |
| 217 | @media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}} |
| 218 | .literalblock pre,.listingblock>.content>pre:not(.highlight),.listingblock>.content>pre[class=highlight],.listingblock>.content>pre[class^="highlight "]{background:#f7f7f8} |
| 219 | .literalblock.output pre{color:#f7f7f8;background:rgba(0,0,0,.9)} |
| 220 | .listingblock>.content{position:relative} |
| 221 | .listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:inherit;opacity:.5} |
| 222 | .listingblock:hover code[data-lang]::before{display:block} |
| 223 | .listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:inherit;opacity:.5} |
| 224 | .listingblock.terminal pre .command:not([data-prompt])::before{content:"$"} |
| 225 | .listingblock pre.highlightjs{padding:0} |
| 226 | .listingblock pre.highlightjs>code{padding:1em;border-radius:4px} |
| 227 | .listingblock pre.prettyprint{border-width:0} |
| 228 | .prettyprint{background:#f7f7f8} |
| 229 | pre.prettyprint .linenums{line-height:1.45;margin-left:2em} |
| 230 | pre.prettyprint li{background:none;list-style-type:inherit;padding-left:0} |
| 231 | pre.prettyprint li code[data-lang]::before{opacity:1} |
| 232 | pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none} |
| 233 | table.linenotable{border-collapse:separate;border:0;margin-bottom:0;background:none} |
| 234 | table.linenotable td[class]{color:inherit;vertical-align:top;padding:0;line-height:inherit;white-space:normal} |
| 235 | table.linenotable td.code{padding-left:.75em} |
| 236 | table.linenotable td.linenos,pre.pygments .linenos{border-right:1px solid;opacity:.35;padding-right:.5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} |
| 237 | pre.pygments span.linenos{display:inline-block;margin-right:.75em} |
| 238 | .quoteblock{margin:0 1em 1.25em 1.5em;display:table} |
| 239 | .quoteblock:not(.excerpt)>.title{margin-left:-1.5em;margin-bottom:.75em} |
| 240 | .quoteblock blockquote,.quoteblock p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify} |
| 241 | .quoteblock blockquote{margin:0;padding:0;border:0} |
| 242 | .quoteblock blockquote::before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)} |
| 243 | .quoteblock blockquote>.paragraph:last-child p{margin-bottom:0} |
| 244 | .quoteblock .attribution{margin-top:.75em;margin-right:.5ex;text-align:right} |
| 245 | .verseblock{margin:0 1em 1.25em} |
| 246 | .verseblock pre{font-family:"Open Sans","DejaVu Sans",sans-serif;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility} |
| 247 | .verseblock pre strong{font-weight:400} |
| 248 | .verseblock .attribution{margin-top:1.25rem;margin-left:.5ex} |
| 249 | .quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic} |
| 250 | .quoteblock .attribution br,.verseblock .attribution br{display:none} |
| 251 | .quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)} |
| 252 | .quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none} |
| 253 | .quoteblock.abstract blockquote,.quoteblock.abstract p,.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{line-height:1.6;word-spacing:0} |
| 254 | .quoteblock.abstract{margin:0 1em 1.25em;display:block} |
| 255 | .quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center} |
| 256 | .quoteblock.excerpt>blockquote,.quoteblock .quoteblock{padding:0 0 .25em 1em;border-left:.25em solid #dddddf} |
| 257 | .quoteblock.excerpt,.quoteblock .quoteblock{margin-left:0} |
| 258 | .quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:1.0625rem} |
| 259 | .quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;font-size:.85rem;text-align:left;margin-right:0} |
| 260 | p.tableblock:last-child{margin-bottom:0} |
| 261 | td.tableblock>.content{margin-bottom:1.25em;word-wrap:anywhere} |
| 262 | td.tableblock>.content>:last-child{margin-bottom:-1.25em} |
| 263 | table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede} |
| 264 | table.grid-all>*>tr>*{border-width:1px} |
| 265 | table.grid-cols>*>tr>*{border-width:0 1px} |
| 266 | table.grid-rows>*>tr>*{border-width:1px 0} |
| 267 | table.frame-all{border-width:1px} |
| 268 | table.frame-ends{border-width:1px 0} |
| 269 | table.frame-sides{border-width:0 1px} |
| 270 | table.frame-none>colgroup+*>:first-child>*,table.frame-sides>colgroup+*>:first-child>*{border-top-width:0} |
| 271 | table.frame-none>:last-child>:last-child>*,table.frame-sides>:last-child>:last-child>*{border-bottom-width:0} |
| 272 | table.frame-none>*>tr>:first-child,table.frame-ends>*>tr>:first-child{border-left-width:0} |
| 273 | table.frame-none>*>tr>:last-child,table.frame-ends>*>tr>:last-child{border-right-width:0} |
| 274 | table.stripes-all>*>tr,table.stripes-odd>*>tr:nth-of-type(odd),table.stripes-even>*>tr:nth-of-type(even),table.stripes-hover>*>tr:hover{background:#f8f8f7} |
| 275 | th.halign-left,td.halign-left{text-align:left} |
| 276 | th.halign-right,td.halign-right{text-align:right} |
| 277 | th.halign-center,td.halign-center{text-align:center} |
| 278 | th.valign-top,td.valign-top{vertical-align:top} |
| 279 | th.valign-bottom,td.valign-bottom{vertical-align:bottom} |
| 280 | th.valign-middle,td.valign-middle{vertical-align:middle} |
| 281 | table thead th,table tfoot th{font-weight:bold} |
| 282 | tbody tr th{background:#f7f8f7} |
| 283 | tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold} |
| 284 | p.tableblock>code:only-child{background:none;padding:0} |
| 285 | p.tableblock{font-size:1em} |
| 286 | ol{margin-left:1.75em} |
| 287 | ul li ol{margin-left:1.5em} |
| 288 | dl dd{margin-left:1.125em} |
| 289 | dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0} |
| 290 | li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em} |
| 291 | ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none} |
| 292 | ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em} |
| 293 | ul.unstyled,ol.unstyled{margin-left:0} |
| 294 | li>p:empty:only-child::before{content:"";display:inline-block} |
| 295 | ul.checklist>li>p:first-child{margin-left:-1em} |
| 296 | ul.checklist>li>p:first-child>.fa-square-o:first-child,ul.checklist>li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em} |
| 297 | ul.checklist>li>p:first-child>input[type=checkbox]:first-child{margin-right:.25em} |
| 298 | ul.inline{display:flex;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em} |
| 299 | ul.inline>li{margin-left:1.25em} |
| 300 | .unstyled dl dt{font-weight:400;font-style:normal} |
| 301 | ol.arabic{list-style-type:decimal} |
| 302 | ol.decimal{list-style-type:decimal-leading-zero} |
| 303 | ol.loweralpha{list-style-type:lower-alpha} |
| 304 | ol.upperalpha{list-style-type:upper-alpha} |
| 305 | ol.lowerroman{list-style-type:lower-roman} |
| 306 | ol.upperroman{list-style-type:upper-roman} |
| 307 | ol.lowergreek{list-style-type:lower-greek} |
| 308 | .hdlist>table,.colist>table{border:0;background:none} |
| 309 | .hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none} |
| 310 | td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em} |
| 311 | td.hdlist1{font-weight:bold;padding-bottom:1.25em} |
| 312 | td.hdlist2{word-wrap:anywhere} |
| 313 | .literalblock+.colist,.listingblock+.colist{margin-top:-.5em} |
| 314 | .colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top} |
| 315 | .colist td:not([class]):first-child img{max-width:none} |
| 316 | .colist td:not([class]):last-child{padding:.25em 0} |
| 317 | .thumb,.th{line-height:0;display:inline-block;border:4px solid #fff;box-shadow:0 0 0 1px #ddd} |
| 318 | .imageblock.left{margin:.25em .625em 1.25em 0} |
| 319 | .imageblock.right{margin:.25em 0 1.25em .625em} |
| 320 | .imageblock>.title{margin-bottom:0} |
| 321 | .imageblock.thumb,.imageblock.th{border-width:6px} |
| 322 | .imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em} |
| 323 | .image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0} |
| 324 | .image.left{margin-right:.625em} |
| 325 | .image.right{margin-left:.625em} |
| 326 | a.image{text-decoration:none;display:inline-block} |
| 327 | a.image object{pointer-events:none} |
| 328 | sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super} |
| 329 | sup.footnote a,sup.footnoteref a{text-decoration:none} |
| 330 | sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline} |
| 331 | #footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em} |
| 332 | #footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0} |
| 333 | #footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em} |
| 334 | #footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em} |
| 335 | #footnotes .footnote:last-of-type{margin-bottom:0} |
| 336 | #content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0} |
| 337 | div.unbreakable{page-break-inside:avoid} |
| 338 | .big{font-size:larger} |
| 339 | .small{font-size:smaller} |
| 340 | .underline{text-decoration:underline} |
| 341 | .overline{text-decoration:overline} |
| 342 | .line-through{text-decoration:line-through} |
| 343 | .aqua{color:#00bfbf} |
| 344 | .aqua-background{background:#00fafa} |
| 345 | .black{color:#000} |
| 346 | .black-background{background:#000} |
| 347 | .blue{color:#0000bf} |
| 348 | .blue-background{background:#0000fa} |
| 349 | .fuchsia{color:#bf00bf} |
| 350 | .fuchsia-background{background:#fa00fa} |
| 351 | .gray{color:#606060} |
| 352 | .gray-background{background:#7d7d7d} |
| 353 | .green{color:#006000} |
| 354 | .green-background{background:#007d00} |
| 355 | .lime{color:#00bf00} |
| 356 | .lime-background{background:#00fa00} |
| 357 | .maroon{color:#600000} |
| 358 | .maroon-background{background:#7d0000} |
| 359 | .navy{color:#000060} |
| 360 | .navy-background{background:#00007d} |
| 361 | .olive{color:#606000} |
| 362 | .olive-background{background:#7d7d00} |
| 363 | .purple{color:#600060} |
| 364 | .purple-background{background:#7d007d} |
| 365 | .red{color:#bf0000} |
| 366 | .red-background{background:#fa0000} |
| 367 | .silver{color:#909090} |
| 368 | .silver-background{background:#bcbcbc} |
| 369 | .teal{color:#006060} |
| 370 | .teal-background{background:#007d7d} |
| 371 | .white{color:#bfbfbf} |
| 372 | .white-background{background:#fafafa} |
| 373 | .yellow{color:#bfbf00} |
| 374 | .yellow-background{background:#fafa00} |
| 375 | span.icon>.fa{cursor:default} |
| 376 | a span.icon>.fa{cursor:inherit} |
| 377 | .admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default} |
| 378 | .admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c} |
| 379 | .admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111} |
| 380 | .admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900} |
| 381 | .admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400} |
| 382 | .admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000} |
| 383 | .conum[data-value]{display:inline-block;color:#fff!important;background:rgba(0,0,0,.8);border-radius:50%;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold} |
| 384 | .conum[data-value] *{color:#fff!important} |
| 385 | .conum[data-value]+b{display:none} |
| 386 | .conum[data-value]::after{content:attr(data-value)} |
| 387 | pre .conum[data-value]{position:relative;top:-.125em} |
| 388 | b.conum *{color:inherit!important} |
| 389 | .conum:not([data-value]):empty{display:none} |
| 390 | dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility} |
| 391 | h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em} |
| 392 | p strong,td.content strong,div.footnote strong{letter-spacing:-.005em} |
| 393 | p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem} |
| 394 | p{margin-bottom:1.25rem} |
| 395 | .sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em} |
| 396 | .exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc} |
| 397 | .print-only{display:none!important} |
| 398 | @page{margin:1.25cm .75cm} |
| 399 | @media print{*{box-shadow:none!important;text-shadow:none!important} |
| 400 | html{font-size:80%} |
| 401 | a{color:inherit!important;text-decoration:underline!important} |
| 402 | a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important} |
| 403 | a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em} |
| 404 | abbr[title]{border-bottom:1px dotted} |
| 405 | abbr[title]::after{content:" (" attr(title) ")"} |
| 406 | pre,blockquote,tr,img,object,svg{page-break-inside:avoid} |
| 407 | thead{display:table-header-group} |
| 408 | svg{max-width:100%} |
| 409 | p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3} |
| 410 | h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid} |
| 411 | #header,#content,#footnotes,#footer{max-width:none} |
| 412 | #toc,.sidebarblock,.exampleblock>.content{background:none!important} |
| 413 | #toc{border-bottom:1px solid #dddddf!important;padding-bottom:0!important} |
| 414 | body.book #header{text-align:center} |
| 415 | body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em} |
| 416 | body.book #header .details{border:0!important;display:block;padding:0!important} |
| 417 | body.book #header .details span:first-child{margin-left:0!important} |
| 418 | body.book #header .details br{display:block} |
| 419 | body.book #header .details br+span::before{content:none!important} |
| 420 | body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important} |
| 421 | body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always} |
| 422 | .listingblock code[data-lang]::before{display:block} |
| 423 | #footer{padding:0 .9375em} |
| 424 | .hide-on-print{display:none!important} |
| 425 | .print-only{display:block!important} |
| 426 | .hide-for-print{display:none!important} |
| 427 | .show-for-print{display:inherit!important}} |
| 428 | @media amzn-kf8,print{#header>h1:first-child{margin-top:1.25rem} |
| 429 | .sect1{padding:0!important} |
| 430 | .sect1+.sect1{border:0} |
| 431 | #footer{background:none} |
| 432 | #footer-text{color:rgba(0,0,0,.6);font-size:.9em}} |
| 433 | @media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}} |
| 434 | </style> |
| 435 | <style> |
| 436 | pre>code { |
| 437 | display: inline; |
| 438 | } |
| 439 | </style> |
| 440 | </head> |
| 441 | <body class="manpage"> |
| 442 | <div id="header"> |
| 443 | <h1>git-pull(1) Manual Page</h1> |
| 444 | <h2 id="_name">NAME</h2> |
| 445 | <div class="sectionbody"> |
| 446 | <p>git-pull - Fetch from and integrate with another repository or a local branch</p> |
| 447 | </div> |
| 448 | </div> |
| 449 | <div id="content"> |
| 450 | <div class="sect1"> |
| 451 | <h2 id="_synopsis">SYNOPSIS</h2> |
| 452 | <div class="sectionbody"> |
| 453 | <div class="verseblock"> |
| 454 | <pre class="content"><em>git pull</em> [<options>] [<repository> [<refspec>…​]]</pre> |
| 455 | </div> |
| 456 | </div> |
| 457 | </div> |
| 458 | <div class="sect1"> |
| 459 | <h2 id="_description">DESCRIPTION</h2> |
| 460 | <div class="sectionbody"> |
| 461 | <div class="paragraph"> |
| 462 | <p>Incorporates changes from a remote repository into the current branch. |
| 463 | If the current branch is behind the remote, then by default it will |
| 464 | fast-forward the current branch to match the remote. If the current |
| 465 | branch and the remote have diverged, the user needs to specify how to |
| 466 | reconcile the divergent branches with <code>--rebase</code> or <code>--no-rebase</code> (or |
| 467 | the corresponding configuration option in <code>pull.rebase</code>).</p> |
| 468 | </div> |
| 469 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 470 | <p>More precisely, <code>git</code> <code>pull</code> runs <code>git</code> <code>fetch</code> with the given parameters |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 471 | and then depending on configuration options or command line flags, |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 472 | will call either <code>git</code> <code>rebase</code> or <code>git</code> <code>merge</code> to reconcile diverging |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 473 | branches.</p> |
| 474 | </div> |
| 475 | <div class="paragraph"> |
| 476 | <p><repository> should be the name of a remote repository as |
| 477 | passed to <a href="git-fetch.html">git-fetch(1)</a>. <refspec> can name an |
| 478 | arbitrary remote ref (for example, the name of a tag) or even |
| 479 | a collection of refs with corresponding remote-tracking branches |
| 480 | (e.g., refs/heads/*:refs/remotes/origin/*), |
| 481 | but usually it is the name of a branch in the remote repository.</p> |
| 482 | </div> |
| 483 | <div class="paragraph"> |
| 484 | <p>Default values for <repository> and <branch> are read from the |
| 485 | "remote" and "merge" configuration for the current branch |
| 486 | as set by <a href="git-branch.html">git-branch(1)</a> <code>--track</code>.</p> |
| 487 | </div> |
| 488 | <div class="paragraph"> |
| 489 | <p>Assume the following history exists and the current branch is |
| 490 | "<code>master</code>":</p> |
| 491 | </div> |
| 492 | <div class="listingblock"> |
| 493 | <div class="content"> |
| 494 | <pre> A---B---C master on origin |
| 495 | / |
| 496 | D---E---F---G master |
| 497 | ^ |
| 498 | origin/master in your repository</pre> |
| 499 | </div> |
| 500 | </div> |
| 501 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 502 | <p>Then "<code>git</code> <code>pull</code>" will fetch and replay the changes from the remote |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 503 | <code>master</code> branch since it diverged from the local <code>master</code> (i.e., <code>E</code>) |
| 504 | until its current commit (<code>C</code>) on top of <code>master</code> and record the |
| 505 | result in a new commit along with the names of the two parent commits |
| 506 | and a log message from the user describing the changes.</p> |
| 507 | </div> |
| 508 | <div class="listingblock"> |
| 509 | <div class="content"> |
| 510 | <pre> A---B---C origin/master |
| 511 | / \ |
| 512 | D---E---F---G---H master</pre> |
| 513 | </div> |
| 514 | </div> |
| 515 | <div class="paragraph"> |
| 516 | <p>See <a href="git-merge.html">git-merge(1)</a> for details, including how conflicts |
| 517 | are presented and handled.</p> |
| 518 | </div> |
| 519 | <div class="paragraph"> |
| 520 | <p>In Git 1.7.0 or later, to cancel a conflicting merge, use |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 521 | <code>git</code> <code>reset</code> <code>--merge</code>. <strong>Warning</strong>: In older versions of Git, running <em>git pull</em> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 522 | with uncommitted changes is discouraged: while possible, it leaves you |
| 523 | in a state that may be hard to back out of in the case of a conflict.</p> |
| 524 | </div> |
| 525 | <div class="paragraph"> |
| 526 | <p>If any of the remote changes overlap with local uncommitted changes, |
| 527 | the merge will be automatically canceled and the work tree untouched. |
| 528 | It is generally best to get any local changes in working order before |
| 529 | pulling or stash them away with <a href="git-stash.html">git-stash(1)</a>.</p> |
| 530 | </div> |
| 531 | </div> |
| 532 | </div> |
| 533 | <div class="sect1"> |
| 534 | <h2 id="_options">OPTIONS</h2> |
| 535 | <div class="sectionbody"> |
| 536 | <div class="dlist"> |
| 537 | <dl> |
| 538 | <dt class="hdlist1">-q</dt> |
| 539 | <dt class="hdlist1">--quiet</dt> |
| 540 | <dd> |
| 541 | <p>This is passed to both underlying git-fetch to squelch reporting of |
| 542 | during transfer, and underlying git-merge to squelch output during |
| 543 | merging.</p> |
| 544 | </dd> |
| 545 | <dt class="hdlist1">-v</dt> |
| 546 | <dt class="hdlist1">--verbose</dt> |
| 547 | <dd> |
| 548 | <p>Pass --verbose to git-fetch and git-merge.</p> |
| 549 | </dd> |
| 550 | <dt class="hdlist1">--[no-]recurse-submodules[=(yes|on-demand|no)]</dt> |
| 551 | <dd> |
| 552 | <p>This option controls if new commits of populated submodules should |
| 553 | be fetched, and if the working trees of active submodules should be |
| 554 | updated, too (see <a href="git-fetch.html">git-fetch(1)</a>, <a href="git-config.html">git-config(1)</a> and |
| 555 | <a href="gitmodules.html">gitmodules(5)</a>).</p> |
| 556 | <div class="paragraph"> |
| 557 | <p>If the checkout is done via rebase, local submodule commits are rebased as well.</p> |
| 558 | </div> |
| 559 | <div class="paragraph"> |
| 560 | <p>If the update is done via merge, the submodule conflicts are resolved and checked out.</p> |
| 561 | </div> |
| 562 | </dd> |
| 563 | </dl> |
| 564 | </div> |
| 565 | <div class="sect2"> |
| 566 | <h3 id="_options_related_to_merging">Options related to merging</h3> |
| 567 | <div class="dlist"> |
| 568 | <dl> |
| 569 | <dt class="hdlist1">--commit</dt> |
| 570 | <dt class="hdlist1">--no-commit</dt> |
| 571 | <dd> |
| 572 | <p>Perform the merge and commit the result. This option can |
| 573 | be used to override --no-commit. |
| 574 | Only useful when merging.</p> |
| 575 | <div class="paragraph"> |
| 576 | <p>With --no-commit perform the merge and stop just before creating |
| 577 | a merge commit, to give the user a chance to inspect and further |
| 578 | tweak the merge result before committing.</p> |
| 579 | </div> |
| 580 | <div class="paragraph"> |
| 581 | <p>Note that fast-forward updates do not create a merge commit and |
| 582 | therefore there is no way to stop those merges with --no-commit. |
| 583 | Thus, if you want to ensure your branch is not changed or updated |
| 584 | by the merge command, use --no-ff with --no-commit.</p> |
| 585 | </div> |
| 586 | </dd> |
| 587 | <dt class="hdlist1">--edit</dt> |
| 588 | <dt class="hdlist1">-e</dt> |
| 589 | <dt class="hdlist1">--no-edit</dt> |
| 590 | <dd> |
| 591 | <p>Invoke an editor before committing successful mechanical merge to |
| 592 | further edit the auto-generated merge message, so that the user |
| 593 | can explain and justify the merge. The <code>--no-edit</code> option can be |
| 594 | used to accept the auto-generated message (this is generally |
| 595 | discouraged).</p> |
| 596 | <div class="paragraph"> |
| 597 | <p>Older scripts may depend on the historical behaviour of not allowing the |
| 598 | user to edit the merge log message. They will see an editor opened when |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 599 | they run <code>git</code> <code>merge</code>. To make it easier to adjust such scripts to the |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 600 | updated behaviour, the environment variable <code>GIT_MERGE_AUTOEDIT</code> can be |
| 601 | set to <code>no</code> at the beginning of them.</p> |
| 602 | </div> |
| 603 | </dd> |
| 604 | <dt class="hdlist1">--cleanup=<mode></dt> |
| 605 | <dd> |
| 606 | <p>This option determines how the merge message will be cleaned up before |
| 607 | committing. See <a href="git-commit.html">git-commit(1)</a> for more details. In addition, if |
| 608 | the <em><mode></em> is given a value of <code>scissors</code>, scissors will be appended |
| 609 | to <code>MERGE_MSG</code> before being passed on to the commit machinery in the |
| 610 | case of a merge conflict.</p> |
| 611 | </dd> |
| 612 | <dt class="hdlist1">--ff-only</dt> |
| 613 | <dd> |
| 614 | <p>Only update to the new history if there is no divergent local |
| 615 | history. This is the default when no method for reconciling |
| 616 | divergent histories is provided (via the --rebase=* flags).</p> |
| 617 | </dd> |
| 618 | <dt class="hdlist1">--ff</dt> |
| 619 | <dt class="hdlist1">--no-ff</dt> |
| 620 | <dd> |
| 621 | <p>When merging rather than rebasing, specifies how a merge is |
| 622 | handled when the merged-in history is already a descendant of |
| 623 | the current history. If merging is requested, <code>--ff</code> is the |
| 624 | default unless merging an annotated (and possibly signed) tag |
| 625 | that is not stored in its natural place in the <code>refs/tags/</code> |
| 626 | hierarchy, in which case <code>--no-ff</code> is assumed.</p> |
| 627 | <div class="paragraph"> |
| 628 | <p>With <code>--ff</code>, when possible resolve the merge as a fast-forward (only |
| 629 | update the branch pointer to match the merged branch; do not create a |
| 630 | merge commit). When not possible (when the merged-in history is not a |
| 631 | descendant of the current history), create a merge commit.</p> |
| 632 | </div> |
| 633 | <div class="paragraph"> |
| 634 | <p>With <code>--no-ff</code>, create a merge commit in all cases, even when the merge |
| 635 | could instead be resolved as a fast-forward.</p> |
| 636 | </div> |
| 637 | </dd> |
| 638 | <dt class="hdlist1">-S[<keyid>]</dt> |
| 639 | <dt class="hdlist1">--gpg-sign[=<keyid>]</dt> |
| 640 | <dt class="hdlist1">--no-gpg-sign</dt> |
| 641 | <dd> |
| 642 | <p>GPG-sign the resulting merge commit. The <code>keyid</code> argument is |
| 643 | optional and defaults to the committer identity; if specified, |
| 644 | it must be stuck to the option without a space. <code>--no-gpg-sign</code> |
| 645 | is useful to countermand both <code>commit.gpgSign</code> configuration variable, |
| 646 | and earlier <code>--gpg-sign</code>.</p> |
| 647 | </dd> |
| 648 | <dt class="hdlist1">--log[=<n>]</dt> |
| 649 | <dt class="hdlist1">--no-log</dt> |
| 650 | <dd> |
| 651 | <p>In addition to branch names, populate the log message with |
| 652 | one-line descriptions from at most <n> actual commits that are being |
| 653 | merged. See also <a href="git-fmt-merge-msg.html">git-fmt-merge-msg(1)</a>. |
| 654 | Only useful when merging.</p> |
| 655 | <div class="paragraph"> |
| 656 | <p>With --no-log do not list one-line descriptions from the |
| 657 | actual commits being merged.</p> |
| 658 | </div> |
| 659 | </dd> |
| 660 | <dt class="hdlist1">--signoff</dt> |
| 661 | <dt class="hdlist1">--no-signoff</dt> |
| 662 | <dd> |
| 663 | <p>Add a <code>Signed-off-by</code> trailer by the committer at the end of the commit |
| 664 | log message. The meaning of a signoff depends on the project |
| 665 | to which you’re committing. For example, it may certify that |
| 666 | the committer has the rights to submit the work under the |
| 667 | project’s license or agrees to some contributor representation, |
| 668 | such as a Developer Certificate of Origin. |
| 669 | (See <a href="https://developercertificate.org" class="bare">https://developercertificate.org</a> for the one used by the |
| 670 | Linux kernel and Git projects.) Consult the documentation or |
| 671 | leadership of the project to which you’re contributing to |
| 672 | understand how the signoffs are used in that project.</p> |
| 673 | <div class="paragraph"> |
| 674 | <p>The --no-signoff option can be used to countermand an earlier --signoff |
| 675 | option on the command line.</p> |
| 676 | </div> |
| 677 | </dd> |
| 678 | <dt class="hdlist1">--stat</dt> |
| 679 | <dt class="hdlist1">-n</dt> |
| 680 | <dt class="hdlist1">--no-stat</dt> |
| 681 | <dd> |
| 682 | <p>Show a diffstat at the end of the merge. The diffstat is also |
| 683 | controlled by the configuration option merge.stat.</p> |
| 684 | <div class="paragraph"> |
| 685 | <p>With -n or --no-stat do not show a diffstat at the end of the |
| 686 | merge.</p> |
| 687 | </div> |
| 688 | </dd> |
| 689 | <dt class="hdlist1">--squash</dt> |
| 690 | <dt class="hdlist1">--no-squash</dt> |
| 691 | <dd> |
| 692 | <p>Produce the working tree and index state as if a real merge |
| 693 | happened (except for the merge information), but do not actually |
| 694 | make a commit, move the <code>HEAD</code>, or record <code>$GIT_DIR/MERGE_HEAD</code> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 695 | (to cause the next <code>git</code> <code>commit</code> command to create a merge |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 696 | commit). This allows you to create a single commit on top of |
| 697 | the current branch whose effect is the same as merging another |
| 698 | branch (or more in case of an octopus).</p> |
| 699 | <div class="paragraph"> |
| 700 | <p>With --no-squash perform the merge and commit the result. This |
| 701 | option can be used to override --squash.</p> |
| 702 | </div> |
| 703 | <div class="paragraph"> |
| 704 | <p>With --squash, --commit is not allowed, and will fail.</p> |
| 705 | </div> |
| 706 | <div class="paragraph"> |
| 707 | <p>Only useful when merging.</p> |
| 708 | </div> |
| 709 | </dd> |
| 710 | <dt class="hdlist1">--[no-]verify</dt> |
| 711 | <dd> |
| 712 | <p>By default, the pre-merge and commit-msg hooks are run. |
| 713 | When <code>--no-verify</code> is given, these are bypassed. |
| 714 | See also <a href="githooks.html">githooks(5)</a>. |
| 715 | Only useful when merging.</p> |
| 716 | </dd> |
| 717 | <dt class="hdlist1">-s <strategy></dt> |
| 718 | <dt class="hdlist1">--strategy=<strategy></dt> |
| 719 | <dd> |
| 720 | <p>Use the given merge strategy; can be supplied more than |
| 721 | once to specify them in the order they should be tried. |
| 722 | If there is no <code>-s</code> option, a built-in list of strategies |
| 723 | is used instead (<code>ort</code> when merging a single head, |
| 724 | <code>octopus</code> otherwise).</p> |
| 725 | </dd> |
| 726 | <dt class="hdlist1">-X <option></dt> |
| 727 | <dt class="hdlist1">--strategy-option=<option></dt> |
| 728 | <dd> |
| 729 | <p>Pass merge strategy specific option through to the merge |
| 730 | strategy.</p> |
| 731 | </dd> |
| 732 | <dt class="hdlist1">--verify-signatures</dt> |
| 733 | <dt class="hdlist1">--no-verify-signatures</dt> |
| 734 | <dd> |
| 735 | <p>Verify that the tip commit of the side branch being merged is |
| 736 | signed with a valid key, i.e. a key that has a valid uid: in the |
| 737 | default trust model, this means the signing key has been signed by |
| 738 | a trusted key. If the tip commit of the side branch is not signed |
| 739 | with a valid key, the merge is aborted.</p> |
| 740 | <div class="paragraph"> |
| 741 | <p>Only useful when merging.</p> |
| 742 | </div> |
| 743 | </dd> |
| 744 | <dt class="hdlist1">--summary</dt> |
| 745 | <dt class="hdlist1">--no-summary</dt> |
| 746 | <dd> |
| 747 | <p>Synonyms to --stat and --no-stat; these are deprecated and will be |
| 748 | removed in the future.</p> |
| 749 | </dd> |
| 750 | <dt class="hdlist1">--autostash</dt> |
| 751 | <dt class="hdlist1">--no-autostash</dt> |
| 752 | <dd> |
| 753 | <p>Automatically create a temporary stash entry before the operation |
| 754 | begins, record it in the ref <code>MERGE_AUTOSTASH</code> |
| 755 | and apply it after the operation ends. This means |
| 756 | that you can run the operation on a dirty worktree. However, use |
| 757 | with care: the final stash application after a successful |
| 758 | merge might result in non-trivial conflicts.</p> |
| 759 | </dd> |
| 760 | <dt class="hdlist1">--allow-unrelated-histories</dt> |
| 761 | <dd> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 762 | <p>By default, <code>git</code> <code>merge</code> command refuses to merge histories |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 763 | that do not share a common ancestor. This option can be |
| 764 | used to override this safety when merging histories of two |
| 765 | projects that started their lives independently. As that is |
| 766 | a very rare occasion, no configuration variable to enable |
| 767 | this by default exists and will not be added.</p> |
| 768 | <div class="paragraph"> |
| 769 | <p>Only useful when merging.</p> |
| 770 | </div> |
| 771 | </dd> |
| 772 | <dt class="hdlist1">-r</dt> |
| 773 | <dt class="hdlist1">--rebase[=(false|true|merges|interactive)]</dt> |
| 774 | <dd> |
| 775 | <p>When true, rebase the current branch on top of the upstream |
| 776 | branch after fetching. If there is a remote-tracking branch |
| 777 | corresponding to the upstream branch and the upstream branch |
| 778 | was rebased since last fetched, the rebase uses that information |
| 779 | to avoid rebasing non-local changes.</p> |
| 780 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 781 | <p>When set to <code>merges</code>, rebase using <code>git</code> <code>rebase</code> <code>--rebase-merges</code> so that |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 782 | the local merge commits are included in the rebase (see |
| 783 | <a href="git-rebase.html">git-rebase(1)</a> for details).</p> |
| 784 | </div> |
| 785 | <div class="paragraph"> |
| 786 | <p>When false, merge the upstream branch into the current branch.</p> |
| 787 | </div> |
| 788 | <div class="paragraph"> |
| 789 | <p>When <code>interactive</code>, enable the interactive mode of rebase.</p> |
| 790 | </div> |
| 791 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 792 | <p>See <code>pull.rebase</code>, <code>branch.</code><em><name></em><code>.rebase</code> and <code>branch.autoSetupRebase</code> in |
| 793 | <a href="git-config.html">git-config(1)</a> if you want to make <code>git</code> <code>pull</code> always use |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 794 | <code>--rebase</code> instead of merging.</p> |
| 795 | </div> |
| 796 | <div class="admonitionblock note"> |
| 797 | <table> |
| 798 | <tr> |
| 799 | <td class="icon"> |
| 800 | <div class="title">Note</div> |
| 801 | </td> |
| 802 | <td class="content"> |
| 803 | This is a potentially <em>dangerous</em> mode of operation. |
| 804 | It rewrites history, which does not bode well when you |
| 805 | published that history already. Do <strong>not</strong> use this option |
| 806 | unless you have read <a href="git-rebase.html">git-rebase(1)</a> carefully. |
| 807 | </td> |
| 808 | </tr> |
| 809 | </table> |
| 810 | </div> |
| 811 | </dd> |
| 812 | <dt class="hdlist1">--no-rebase</dt> |
| 813 | <dd> |
| 814 | <p>This is shorthand for --rebase=false.</p> |
| 815 | </dd> |
| 816 | </dl> |
| 817 | </div> |
| 818 | </div> |
| 819 | <div class="sect2"> |
| 820 | <h3 id="_options_related_to_fetching">Options related to fetching</h3> |
| 821 | <div class="dlist"> |
| 822 | <dl> |
| 823 | <dt class="hdlist1">--[no-]all</dt> |
| 824 | <dd> |
Junio C Hamano | 210f01b | 2024-09-14 16:10:50 | [diff] [blame] | 825 | <p>Fetch all remotes, except for the ones that has the |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 826 | <code>remote.</code><em><name></em><code>.skipFetchAll</code> configuration variable set. |
Junio C Hamano | 210f01b | 2024-09-14 16:10:50 | [diff] [blame] | 827 | This overrides the configuration variable fetch.all`.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 828 | </dd> |
| 829 | <dt class="hdlist1">-a</dt> |
| 830 | <dt class="hdlist1">--append</dt> |
| 831 | <dd> |
| 832 | <p>Append ref names and object names of fetched refs to the |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 833 | existing contents of .<code>git/FETCH_HEAD</code>. Without this |
| 834 | option old data in .<code>git/FETCH_HEAD</code> will be overwritten.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 835 | </dd> |
| 836 | <dt class="hdlist1">--atomic</dt> |
| 837 | <dd> |
| 838 | <p>Use an atomic transaction to update local refs. Either all refs are |
| 839 | updated, or on error, no refs are updated.</p> |
| 840 | </dd> |
| 841 | <dt class="hdlist1">--depth=<depth></dt> |
| 842 | <dd> |
| 843 | <p>Limit fetching to the specified number of commits from the tip of |
| 844 | each remote branch history. If fetching to a <em>shallow</em> repository |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 845 | created by <code>git</code> <code>clone</code> with <code>--depth=</code><em><depth></em> option (see |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 846 | <a href="git-clone.html">git-clone(1)</a>), deepen or shorten the history to the specified |
| 847 | number of commits. Tags for the deepened commits are not fetched.</p> |
| 848 | </dd> |
| 849 | <dt class="hdlist1">--deepen=<depth></dt> |
| 850 | <dd> |
| 851 | <p>Similar to --depth, except it specifies the number of commits |
| 852 | from the current shallow boundary instead of from the tip of |
| 853 | each remote branch history.</p> |
| 854 | </dd> |
| 855 | <dt class="hdlist1">--shallow-since=<date></dt> |
| 856 | <dd> |
| 857 | <p>Deepen or shorten the history of a shallow repository to |
| 858 | include all reachable commits after <date>.</p> |
| 859 | </dd> |
| 860 | <dt class="hdlist1">--shallow-exclude=<revision></dt> |
| 861 | <dd> |
| 862 | <p>Deepen or shorten the history of a shallow repository to |
| 863 | exclude commits reachable from a specified remote branch or tag. |
| 864 | This option can be specified multiple times.</p> |
| 865 | </dd> |
| 866 | <dt class="hdlist1">--unshallow</dt> |
| 867 | <dd> |
| 868 | <p>If the source repository is complete, convert a shallow |
| 869 | repository to a complete one, removing all the limitations |
| 870 | imposed by shallow repositories.</p> |
| 871 | <div class="paragraph"> |
| 872 | <p>If the source repository is shallow, fetch as much as possible so that |
| 873 | the current repository has the same history as the source repository.</p> |
| 874 | </div> |
| 875 | </dd> |
| 876 | <dt class="hdlist1">--update-shallow</dt> |
| 877 | <dd> |
| 878 | <p>By default when fetching from a shallow repository, |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 879 | <code>git</code> <code>fetch</code> refuses refs that require updating |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 880 | .git/shallow. This option updates .git/shallow and accepts such |
| 881 | refs.</p> |
| 882 | </dd> |
| 883 | <dt class="hdlist1">--negotiation-tip=<commit|glob></dt> |
| 884 | <dd> |
| 885 | <p>By default, Git will report, to the server, commits reachable |
| 886 | from all local refs to find common commits in an attempt to |
| 887 | reduce the size of the to-be-received packfile. If specified, |
| 888 | Git will only report commits reachable from the given tips. |
| 889 | This is useful to speed up fetches when the user knows which |
| 890 | local ref is likely to have commits in common with the |
| 891 | upstream ref being fetched.</p> |
| 892 | <div class="paragraph"> |
| 893 | <p>This option may be specified more than once; if so, Git will report |
| 894 | commits reachable from any of the given commits.</p> |
| 895 | </div> |
| 896 | <div class="paragraph"> |
| 897 | <p>The argument to this option may be a glob on ref names, a ref, or the (possibly |
| 898 | abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying |
| 899 | this option multiple times, one for each matching ref name.</p> |
| 900 | </div> |
| 901 | <div class="paragraph"> |
| 902 | <p>See also the <code>fetch.negotiationAlgorithm</code> and <code>push.negotiate</code> |
| 903 | configuration variables documented in <a href="git-config.html">git-config(1)</a>, and the |
| 904 | <code>--negotiate-only</code> option below.</p> |
| 905 | </div> |
| 906 | </dd> |
| 907 | <dt class="hdlist1">--negotiate-only</dt> |
| 908 | <dd> |
| 909 | <p>Do not fetch anything from the server, and instead print the |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 910 | ancestors of the provided <code>--negotiation-tip=</code>* arguments, |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 911 | which we have in common with the server.</p> |
| 912 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 913 | <p>This is incompatible with <code>--recurse-submodules=</code>[<code>yes</code>|<code>on-demand</code>]. |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 914 | Internally this is used to implement the <code>push.negotiate</code> option, see |
| 915 | <a href="git-config.html">git-config(1)</a>.</p> |
| 916 | </div> |
| 917 | </dd> |
| 918 | <dt class="hdlist1">--dry-run</dt> |
| 919 | <dd> |
| 920 | <p>Show what would be done, without making any changes.</p> |
| 921 | </dd> |
| 922 | <dt class="hdlist1">--porcelain</dt> |
| 923 | <dd> |
| 924 | <p>Print the output to standard output in an easy-to-parse format for |
| 925 | scripts. See section OUTPUT in <a href="git-fetch.html">git-fetch(1)</a> for details.</p> |
| 926 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 927 | <p>This is incompatible with <code>--recurse-submodules=</code>[<code>yes</code>|<code>on-demand</code>] and takes |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 928 | precedence over the <code>fetch.output</code> config option.</p> |
| 929 | </div> |
| 930 | </dd> |
| 931 | <dt class="hdlist1">-f</dt> |
| 932 | <dt class="hdlist1">--force</dt> |
| 933 | <dd> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 934 | <p>When <em>git fetch</em> is used with <em><src></em><code>:</code><em><dst></em> refspec, it may |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 935 | refuse to update the local branch as discussed |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 936 | in the <em><refspec></em> part of the <a href="git-fetch.html">git-fetch(1)</a> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 937 | documentation. |
| 938 | This option overrides that check.</p> |
| 939 | </dd> |
| 940 | <dt class="hdlist1">-k</dt> |
| 941 | <dt class="hdlist1">--keep</dt> |
| 942 | <dd> |
| 943 | <p>Keep downloaded pack.</p> |
| 944 | </dd> |
| 945 | <dt class="hdlist1">--prefetch</dt> |
| 946 | <dd> |
| 947 | <p>Modify the configured refspec to place all refs into the |
| 948 | <code>refs/prefetch/</code> namespace. See the <code>prefetch</code> task in |
| 949 | <a href="git-maintenance.html">git-maintenance(1)</a>.</p> |
| 950 | </dd> |
| 951 | <dt class="hdlist1">-p</dt> |
| 952 | <dt class="hdlist1">--prune</dt> |
| 953 | <dd> |
| 954 | <p>Before fetching, remove any remote-tracking references that no |
| 955 | longer exist on the remote. Tags are not subject to pruning |
| 956 | if they are fetched only because of the default tag |
| 957 | auto-following or due to a --tags option. However, if tags |
| 958 | are fetched due to an explicit refspec (either on the command |
| 959 | line or in the remote configuration, for example if the remote |
| 960 | was cloned with the --mirror option), then they are also |
| 961 | subject to pruning. Supplying <code>--prune-tags</code> is a shorthand for |
| 962 | providing the tag refspec.</p> |
| 963 | </dd> |
| 964 | <dt class="hdlist1">--no-tags</dt> |
| 965 | <dd> |
| 966 | <p>By default, tags that point at objects that are downloaded |
| 967 | from the remote repository are fetched and stored locally. |
| 968 | This option disables this automatic tag following. The default |
| 969 | behavior for a remote may be specified with the remote.<name>.tagOpt |
| 970 | setting. See <a href="git-config.html">git-config(1)</a>.</p> |
| 971 | </dd> |
| 972 | <dt class="hdlist1">--refmap=<refspec></dt> |
| 973 | <dd> |
| 974 | <p>When fetching refs listed on the command line, use the |
| 975 | specified refspec (can be given more than once) to map the |
| 976 | refs to remote-tracking branches, instead of the values of |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 977 | <code>remote.</code>*.<code>fetch</code> configuration variables for the remote |
| 978 | repository. Providing an empty <em><refspec></em> to the |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 979 | <code>--refmap</code> option causes Git to ignore the configured |
| 980 | refspecs and rely entirely on the refspecs supplied as |
| 981 | command-line arguments. See section on "Configured Remote-tracking |
| 982 | Branches" for details.</p> |
| 983 | </dd> |
| 984 | <dt class="hdlist1">-t</dt> |
| 985 | <dt class="hdlist1">--tags</dt> |
| 986 | <dd> |
| 987 | <p>Fetch all tags from the remote (i.e., fetch remote tags |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 988 | <code>refs/tags/</code>* into local tags with the same name), in addition |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 989 | to whatever else would otherwise be fetched. Using this |
| 990 | option alone does not subject tags to pruning, even if --prune |
| 991 | is used (though tags may be pruned anyway if they are also the |
| 992 | destination of an explicit refspec; see <code>--prune</code>).</p> |
| 993 | </dd> |
| 994 | <dt class="hdlist1">-j</dt> |
| 995 | <dt class="hdlist1">--jobs=<n></dt> |
| 996 | <dd> |
| 997 | <p>Number of parallel children to be used for all forms of fetching.</p> |
| 998 | <div class="paragraph"> |
| 999 | <p>If the <code>--multiple</code> option was specified, the different remotes will be fetched |
| 1000 | in parallel. If multiple submodules are fetched, they will be fetched in |
| 1001 | parallel. To control them independently, use the config settings |
| 1002 | <code>fetch.parallel</code> and <code>submodule.fetchJobs</code> (see <a href="git-config.html">git-config(1)</a>).</p> |
| 1003 | </div> |
| 1004 | <div class="paragraph"> |
| 1005 | <p>Typically, parallel recursive and multi-remote fetches will be faster. By |
| 1006 | default fetches are performed sequentially, not in parallel.</p> |
| 1007 | </div> |
| 1008 | </dd> |
| 1009 | <dt class="hdlist1">--set-upstream</dt> |
| 1010 | <dd> |
| 1011 | <p>If the remote is fetched successfully, add upstream |
| 1012 | (tracking) reference, used by argument-less |
| 1013 | <a href="git-pull.html">git-pull(1)</a> and other commands. For more information, |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1014 | see <code>branch.</code><em><name></em><code>.merge</code> and <code>branch.</code><em><name></em><code>.remote</code> in |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1015 | <a href="git-config.html">git-config(1)</a>.</p> |
| 1016 | </dd> |
| 1017 | <dt class="hdlist1">--upload-pack <upload-pack></dt> |
| 1018 | <dd> |
| 1019 | <p>When given, and the repository to fetch from is handled |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1020 | by <em>git fetch-pack</em>, <code>--exec=</code><em><upload-pack></em> is passed to |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1021 | the command to specify non-default path for the command |
| 1022 | run on the other end.</p> |
| 1023 | </dd> |
| 1024 | <dt class="hdlist1">--progress</dt> |
| 1025 | <dd> |
| 1026 | <p>Progress status is reported on the standard error stream |
| 1027 | by default when it is attached to a terminal, unless -q |
| 1028 | is specified. This flag forces progress status even if the |
| 1029 | standard error stream is not directed to a terminal.</p> |
| 1030 | </dd> |
| 1031 | <dt class="hdlist1">-o <option></dt> |
| 1032 | <dt class="hdlist1">--server-option=<option></dt> |
| 1033 | <dd> |
| 1034 | <p>Transmit the given string to the server when communicating using |
| 1035 | protocol version 2. The given string must not contain a NUL or LF |
| 1036 | character. The server’s handling of server options, including |
| 1037 | unknown ones, is server-specific. |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1038 | When multiple <code>--server-option=</code><em><option></em> are given, they are all |
Junio C Hamano | f4e4f53 | 2024-11-02 05:48:11 | [diff] [blame^] | 1039 | sent to the other side in the order listed on the command line. |
| 1040 | When no <code>--server-option=</code><em><option></em> is given from the command line, |
| 1041 | the values of configuration variable <code>remote.</code><em><name></em><code>.serverOption</code> |
| 1042 | are used instead.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1043 | </dd> |
| 1044 | <dt class="hdlist1">--show-forced-updates</dt> |
| 1045 | <dd> |
| 1046 | <p>By default, git checks if a branch is force-updated during |
| 1047 | fetch. This can be disabled through fetch.showForcedUpdates, but |
| 1048 | the --show-forced-updates option guarantees this check occurs. |
| 1049 | See <a href="git-config.html">git-config(1)</a>.</p> |
| 1050 | </dd> |
| 1051 | <dt class="hdlist1">--no-show-forced-updates</dt> |
| 1052 | <dd> |
| 1053 | <p>By default, git checks if a branch is force-updated during |
| 1054 | fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates |
| 1055 | to false to skip this check for performance reasons. If used during |
| 1056 | <em>git-pull</em> the --ff-only option will still check for forced updates |
| 1057 | before attempting a fast-forward update. See <a href="git-config.html">git-config(1)</a>.</p> |
| 1058 | </dd> |
| 1059 | <dt class="hdlist1">-4</dt> |
| 1060 | <dt class="hdlist1">--ipv4</dt> |
| 1061 | <dd> |
| 1062 | <p>Use IPv4 addresses only, ignoring IPv6 addresses.</p> |
| 1063 | </dd> |
| 1064 | <dt class="hdlist1">-6</dt> |
| 1065 | <dt class="hdlist1">--ipv6</dt> |
| 1066 | <dd> |
| 1067 | <p>Use IPv6 addresses only, ignoring IPv4 addresses.</p> |
| 1068 | </dd> |
| 1069 | <dt class="hdlist1"><repository></dt> |
| 1070 | <dd> |
| 1071 | <p>The "remote" repository that is the source of a fetch |
| 1072 | or pull operation. This parameter can be either a URL |
| 1073 | (see the section <a href="#URLS">GIT URLS</a> below) or the name |
| 1074 | of a remote (see the section <a href="#REMOTES">REMOTES</a> below).</p> |
| 1075 | </dd> |
| 1076 | <dt class="hdlist1"><refspec></dt> |
| 1077 | <dd> |
| 1078 | <p>Specifies which refs to fetch and which local refs to update. |
| 1079 | When no <refspec>s appear on the command line, the refs to fetch |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1080 | are read from <code>remote.</code><em><repository></em><code>.fetch</code> variables instead |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1081 | (see the section "CONFIGURED REMOTE-TRACKING BRANCHES" |
| 1082 | in <a href="git-fetch.html">git-fetch(1)</a>).</p> |
| 1083 | <div class="paragraph"> |
| 1084 | <p>The format of a <refspec> parameter is an optional plus |
| 1085 | <code>+</code>, followed by the source <src>, followed |
Junio C Hamano | f4e4f53 | 2024-11-02 05:48:11 | [diff] [blame^] | 1086 | by a colon <code>:</code>, followed by the destination <dst>. |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1087 | The colon can be omitted when <dst> is empty. <src> is |
Junio C Hamano | f4e4f53 | 2024-11-02 05:48:11 | [diff] [blame^] | 1088 | typically a ref, or a glob pattern with a single * that is used |
| 1089 | to match a set of refs, but it can also be a fully spelled hex object |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1090 | name.</p> |
| 1091 | </div> |
| 1092 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1093 | <p>A <refspec> may contain a * in its <src> to indicate a simple pattern |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1094 | match. Such a refspec functions like a glob that matches any ref with the |
Junio C Hamano | f4e4f53 | 2024-11-02 05:48:11 | [diff] [blame^] | 1095 | pattern. A pattern <refspec> must have one and only one * in both the <src> and |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1096 | <dst>. It will map refs to the destination by replacing the * with the |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1097 | contents matched from the source.</p> |
| 1098 | </div> |
| 1099 | <div class="paragraph"> |
| 1100 | <p>If a refspec is prefixed by <code>^</code>, it will be interpreted as a negative |
| 1101 | refspec. Rather than specifying which refs to fetch or which local refs to |
| 1102 | update, such a refspec will instead specify refs to exclude. A ref will be |
| 1103 | considered to match if it matches at least one positive refspec, and does |
| 1104 | not match any negative refspec. Negative refspecs can be useful to restrict |
| 1105 | the scope of a pattern refspec so that it will not include specific refs. |
| 1106 | Negative refspecs can themselves be pattern refspecs. However, they may only |
| 1107 | contain a <src> and do not specify a <dst>. Fully spelled out hex object |
| 1108 | names are also not supported.</p> |
| 1109 | </div> |
| 1110 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1111 | <p><code>tag</code> <em><tag></em> means the same as <code>refs/tags/</code><em><tag></em><code>:refs/tags/</code><em><tag></em>; |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1112 | it requests fetching everything up to the given tag.</p> |
| 1113 | </div> |
| 1114 | <div class="paragraph"> |
| 1115 | <p>The remote ref that matches <src> |
| 1116 | is fetched, and if <dst> is not an empty string, an attempt |
| 1117 | is made to update the local ref that matches it.</p> |
| 1118 | </div> |
| 1119 | <div class="paragraph"> |
| 1120 | <p>Whether that update is allowed without <code>--force</code> depends on the ref |
| 1121 | namespace it’s being fetched to, the type of object being fetched, and |
| 1122 | whether the update is considered to be a fast-forward. Generally, the |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1123 | same rules apply for fetching as when pushing, see the <em><refspec></em>... |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1124 | section of <a href="git-push.html">git-push(1)</a> for what those are. Exceptions to those |
| 1125 | rules particular to <em>git fetch</em> are noted below.</p> |
| 1126 | </div> |
| 1127 | <div class="paragraph"> |
| 1128 | <p>Until Git version 2.20, and unlike when pushing with |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1129 | <a href="git-push.html">git-push(1)</a>, any updates to <code>refs/tags/</code>* would be accepted |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1130 | without <code>+</code> in the refspec (or <code>--force</code>). When fetching, we promiscuously |
| 1131 | considered all tag updates from a remote to be forced fetches. Since |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1132 | Git version 2.20, fetching to update <code>refs/tags/</code>* works the same way |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1133 | as when pushing. I.e. any updates will be rejected without <code>+</code> in the |
| 1134 | refspec (or <code>--force</code>).</p> |
| 1135 | </div> |
| 1136 | <div class="paragraph"> |
| 1137 | <p>Unlike when pushing with <a href="git-push.html">git-push(1)</a>, any updates outside of |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1138 | <code>refs/</code>{tags,heads}/* will be accepted without <code>+</code> in the refspec (or |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1139 | <code>--force</code>), whether that’s swapping e.g. a tree object for a blob, or |
| 1140 | a commit for another commit that doesn’t have the previous commit as |
| 1141 | an ancestor etc.</p> |
| 1142 | </div> |
| 1143 | <div class="paragraph"> |
| 1144 | <p>Unlike when pushing with <a href="git-push.html">git-push(1)</a>, there is no |
| 1145 | configuration which’ll amend these rules, and nothing like a |
| 1146 | <code>pre-fetch</code> hook analogous to the <code>pre-receive</code> hook.</p> |
| 1147 | </div> |
| 1148 | <div class="paragraph"> |
| 1149 | <p>As with pushing with <a href="git-push.html">git-push(1)</a>, all of the rules described |
| 1150 | above about what’s not allowed as an update can be overridden by |
| 1151 | adding an optional leading <code>+</code> to a refspec (or using the <code>--force</code> |
| 1152 | command line option). The only exception to this is that no amount of |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1153 | forcing will make the <code>refs/heads/</code>* namespace accept a non-commit |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1154 | object.</p> |
| 1155 | </div> |
| 1156 | <div class="admonitionblock note"> |
| 1157 | <table> |
| 1158 | <tr> |
| 1159 | <td class="icon"> |
| 1160 | <div class="title">Note</div> |
| 1161 | </td> |
| 1162 | <td class="content"> |
| 1163 | When the remote branch you want to fetch is known to |
| 1164 | be rewound and rebased regularly, it is expected that |
| 1165 | its new tip will not be a descendant of its previous tip |
| 1166 | (as stored in your remote-tracking branch the last time |
| 1167 | you fetched). You would want |
| 1168 | to use the <code>+</code> sign to indicate non-fast-forward updates |
| 1169 | will be needed for such branches. There is no way to |
| 1170 | determine or declare that a branch will be made available |
| 1171 | in a repository with this behavior; the pulling user simply |
| 1172 | must know this is the expected usage pattern for a branch. |
| 1173 | </td> |
| 1174 | </tr> |
| 1175 | </table> |
| 1176 | </div> |
| 1177 | <div class="admonitionblock note"> |
| 1178 | <table> |
| 1179 | <tr> |
| 1180 | <td class="icon"> |
| 1181 | <div class="title">Note</div> |
| 1182 | </td> |
| 1183 | <td class="content"> |
| 1184 | There is a difference between listing multiple <refspec> |
| 1185 | directly on <em>git pull</em> command line and having multiple |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1186 | <code>remote.</code><em><repository></em><code>.fetch</code> entries in your configuration |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1187 | for a <repository> and running a |
| 1188 | <em>git pull</em> command without any explicit <refspec> parameters. |
| 1189 | <refspec>s listed explicitly on the command line are always |
| 1190 | merged into the current branch after fetching. In other words, |
| 1191 | if you list more than one remote ref, <em>git pull</em> will create |
| 1192 | an Octopus merge. On the other hand, if you do not list any |
| 1193 | explicit <refspec> parameter on the command line, <em>git pull</em> |
| 1194 | will fetch all the <refspec>s it finds in the |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1195 | <code>remote.</code><em><repository></em><code>.fetch</code> configuration and merge |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1196 | only the first <refspec> found into the current branch. |
| 1197 | This is because making an |
| 1198 | Octopus from remote refs is rarely done, while keeping track |
| 1199 | of multiple remote heads in one-go by fetching more than one |
| 1200 | is often useful. |
| 1201 | </td> |
| 1202 | </tr> |
| 1203 | </table> |
| 1204 | </div> |
| 1205 | </dd> |
| 1206 | </dl> |
| 1207 | </div> |
| 1208 | </div> |
| 1209 | </div> |
| 1210 | </div> |
| 1211 | <div class="sect1"> |
| 1212 | <h2 id="_git_urls">GIT URLS<a id="URLS"></a></h2> |
| 1213 | <div class="sectionbody"> |
| 1214 | <div class="paragraph"> |
| 1215 | <p>In general, URLs contain information about the transport protocol, the |
| 1216 | address of the remote server, and the path to the repository. |
| 1217 | Depending on the transport protocol, some of this information may be |
| 1218 | absent.</p> |
| 1219 | </div> |
| 1220 | <div class="paragraph"> |
| 1221 | <p>Git supports ssh, git, http, and https protocols (in addition, ftp |
| 1222 | and ftps can be used for fetching, but this is inefficient and |
| 1223 | deprecated; do not use them).</p> |
| 1224 | </div> |
| 1225 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1226 | <p>The native transport (i.e. <code>git://</code> URL) does no authentication and |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1227 | should be used with caution on unsecured networks.</p> |
| 1228 | </div> |
| 1229 | <div class="paragraph"> |
| 1230 | <p>The following syntaxes may be used with them:</p> |
| 1231 | </div> |
| 1232 | <div class="ulist"> |
| 1233 | <ul> |
| 1234 | <li> |
| 1235 | <p><code>ssh://</code>[<em><user></em><code>@</code>]<em><host></em>[<code>:</code><em><port></em>]<code>/</code><em><path-to-git-repo></em></p> |
| 1236 | </li> |
| 1237 | <li> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1238 | <p><code>git://</code><em><host></em>[<code>:</code><em><port></em>]<code>/</code><em><path-to-git-repo></em></p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1239 | </li> |
| 1240 | <li> |
| 1241 | <p><code>http</code>[<code>s</code>]<code>://</code><em><host></em>[<code>:</code><em><port></em>]<code>/</code><em><path-to-git-repo></em></p> |
| 1242 | </li> |
| 1243 | <li> |
| 1244 | <p><code>ftp</code>[<code>s</code>]<code>://</code><em><host></em>[<code>:</code><em><port></em>]<code>/</code><em><path-to-git-repo></em></p> |
| 1245 | </li> |
| 1246 | </ul> |
| 1247 | </div> |
| 1248 | <div class="paragraph"> |
| 1249 | <p>An alternative scp-like syntax may also be used with the ssh protocol:</p> |
| 1250 | </div> |
| 1251 | <div class="ulist"> |
| 1252 | <ul> |
| 1253 | <li> |
| 1254 | <p>[<em><user></em><code>@</code>]<em><host></em><code>:/</code><em><path-to-git-repo></em></p> |
| 1255 | </li> |
| 1256 | </ul> |
| 1257 | </div> |
| 1258 | <div class="paragraph"> |
| 1259 | <p>This syntax is only recognized if there are no slashes before the |
| 1260 | first colon. This helps differentiate a local path that contains a |
| 1261 | colon. For example the local path <code>foo:bar</code> could be specified as an |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1262 | absolute path or .<code>/foo:bar</code> to avoid being misinterpreted as an ssh |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1263 | url.</p> |
| 1264 | </div> |
| 1265 | <div class="paragraph"> |
| 1266 | <p>The ssh and git protocols additionally support <code>~</code><em><username></em> expansion:</p> |
| 1267 | </div> |
| 1268 | <div class="ulist"> |
| 1269 | <ul> |
| 1270 | <li> |
| 1271 | <p><code>ssh://</code>[<em><user></em><code>@</code>]<em><host></em>[<code>:</code><em><port></em>]<code>/~</code><em><user></em><code>/</code><em><path-to-git-repo></em></p> |
| 1272 | </li> |
| 1273 | <li> |
| 1274 | <p><code>git://</code><em><host></em>[<code>:</code><em><port></em>]<code>/~</code><em><user></em><code>/</code><em><path-to-git-repo></em></p> |
| 1275 | </li> |
| 1276 | <li> |
| 1277 | <p>[<em><user></em><code>@</code>]<em><host></em><code>:~</code><em><user></em><code>/</code><em><path-to-git-repo></em></p> |
| 1278 | </li> |
| 1279 | </ul> |
| 1280 | </div> |
| 1281 | <div class="paragraph"> |
| 1282 | <p>For local repositories, also supported by Git natively, the following |
| 1283 | syntaxes may be used:</p> |
| 1284 | </div> |
| 1285 | <div class="ulist"> |
| 1286 | <ul> |
| 1287 | <li> |
| 1288 | <p><code>/path/to/repo.git/</code></p> |
| 1289 | </li> |
| 1290 | <li> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1291 | <p><code>file:///path/to/repo.git/</code></p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1292 | </li> |
| 1293 | </ul> |
| 1294 | </div> |
| 1295 | <div class="paragraph"> |
| 1296 | <p>These two syntaxes are mostly equivalent, except when cloning, when |
| 1297 | the former implies <code>--local</code> option. See <a href="git-clone.html">git-clone(1)</a> for |
| 1298 | details.</p> |
| 1299 | </div> |
| 1300 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1301 | <p><code>git</code> <code>clone</code>, <code>git</code> <code>fetch</code> and <code>git</code> <code>pull</code>, but not <code>git</code> <code>push</code>, will also |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1302 | accept a suitable bundle file. See <a href="git-bundle.html">git-bundle(1)</a>.</p> |
| 1303 | </div> |
| 1304 | <div class="paragraph"> |
| 1305 | <p>When Git doesn’t know how to handle a certain transport protocol, it |
| 1306 | attempts to use the <code>remote-</code><em><transport></em> remote helper, if one |
| 1307 | exists. To explicitly request a remote helper, the following syntax |
| 1308 | may be used:</p> |
| 1309 | </div> |
| 1310 | <div class="ulist"> |
| 1311 | <ul> |
| 1312 | <li> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1313 | <p><em><transport></em><code>::</code><em><address></em></p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1314 | </li> |
| 1315 | </ul> |
| 1316 | </div> |
| 1317 | <div class="paragraph"> |
| 1318 | <p>where <em><address></em> may be a path, a server and path, or an arbitrary |
| 1319 | URL-like string recognized by the specific remote helper being |
| 1320 | invoked. See <a href="gitremote-helpers.html">gitremote-helpers(7)</a> for details.</p> |
| 1321 | </div> |
| 1322 | <div class="paragraph"> |
| 1323 | <p>If there are a large number of similarly-named remote repositories and |
| 1324 | you want to use a different format for them (such that the URLs you |
| 1325 | use will be rewritten into URLs that work), you can create a |
| 1326 | configuration section of the form:</p> |
| 1327 | </div> |
| 1328 | <div class="verseblock"> |
| 1329 | <pre class="content"> [url "<em><actual-url-base></em>"] |
| 1330 | insteadOf = <em><other-url-base></em></pre> |
| 1331 | </div> |
| 1332 | <div class="paragraph"> |
| 1333 | <p>For example, with this:</p> |
| 1334 | </div> |
| 1335 | <div class="listingblock"> |
| 1336 | <div class="content"> |
| 1337 | <pre> [url "git://git.host.xz/"] |
| 1338 | insteadOf = host.xz:/path/to/ |
| 1339 | insteadOf = work:</pre> |
| 1340 | </div> |
| 1341 | </div> |
| 1342 | <div class="paragraph"> |
| 1343 | <p>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be |
| 1344 | rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</p> |
| 1345 | </div> |
| 1346 | <div class="paragraph"> |
| 1347 | <p>If you want to rewrite URLs for push only, you can create a |
| 1348 | configuration section of the form:</p> |
| 1349 | </div> |
| 1350 | <div class="verseblock"> |
| 1351 | <pre class="content"> [url "<em><actual-url-base></em>"] |
| 1352 | pushInsteadOf = <em><other-url-base></em></pre> |
| 1353 | </div> |
| 1354 | <div class="paragraph"> |
| 1355 | <p>For example, with this:</p> |
| 1356 | </div> |
| 1357 | <div class="listingblock"> |
| 1358 | <div class="content"> |
| 1359 | <pre> [url "ssh://example.org/"] |
| 1360 | pushInsteadOf = git://example.org/</pre> |
| 1361 | </div> |
| 1362 | </div> |
| 1363 | <div class="paragraph"> |
| 1364 | <p>a URL like "git://example.org/path/to/repo.git" will be rewritten to |
| 1365 | "ssh://example.org/path/to/repo.git" for pushes, but pulls will still |
| 1366 | use the original URL.</p> |
| 1367 | </div> |
| 1368 | </div> |
| 1369 | </div> |
| 1370 | <div class="sect1"> |
| 1371 | <h2 id="_remotes">REMOTES<a id="REMOTES"></a></h2> |
| 1372 | <div class="sectionbody"> |
| 1373 | <div class="paragraph"> |
| 1374 | <p>The name of one of the following can be used instead |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1375 | of a URL as <em><repository></em> argument:</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1376 | </div> |
| 1377 | <div class="ulist"> |
| 1378 | <ul> |
| 1379 | <li> |
| 1380 | <p>a remote in the Git configuration file: <code>$GIT_DIR/config</code>,</p> |
| 1381 | </li> |
| 1382 | <li> |
| 1383 | <p>a file in the <code>$GIT_DIR/remotes</code> directory, or</p> |
| 1384 | </li> |
| 1385 | <li> |
| 1386 | <p>a file in the <code>$GIT_DIR/branches</code> directory.</p> |
| 1387 | </li> |
| 1388 | </ul> |
| 1389 | </div> |
| 1390 | <div class="paragraph"> |
| 1391 | <p>All of these also allow you to omit the refspec from the command line |
| 1392 | because they each contain a refspec which git will use by default.</p> |
| 1393 | </div> |
| 1394 | <div class="sect2"> |
| 1395 | <h3 id="_named_remote_in_configuration_file">Named remote in configuration file</h3> |
| 1396 | <div class="paragraph"> |
| 1397 | <p>You can choose to provide the name of a remote which you had previously |
| 1398 | configured using <a href="git-remote.html">git-remote(1)</a>, <a href="git-config.html">git-config(1)</a> |
| 1399 | or even by a manual edit to the <code>$GIT_DIR/config</code> file. The URL of |
| 1400 | this remote will be used to access the repository. The refspec |
| 1401 | of this remote will be used by default when you do |
| 1402 | not provide a refspec on the command line. The entry in the |
| 1403 | config file would appear like this:</p> |
| 1404 | </div> |
| 1405 | <div class="listingblock"> |
| 1406 | <div class="content"> |
| 1407 | <pre> [remote "<name>"] |
| 1408 | url = <URL> |
| 1409 | pushurl = <pushurl> |
| 1410 | push = <refspec> |
| 1411 | fetch = <refspec></pre> |
| 1412 | </div> |
| 1413 | </div> |
| 1414 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1415 | <p>The <em><pushurl></em> is used for pushes only. It is optional and defaults |
| 1416 | to <em><URL></em>. Pushing to a remote affects all defined pushurls or all |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1417 | defined urls if no pushurls are defined. Fetch, however, will only |
| 1418 | fetch from the first defined url if multiple urls are defined.</p> |
| 1419 | </div> |
| 1420 | </div> |
| 1421 | <div class="sect2"> |
| 1422 | <h3 id="_named_file_in_git_dirremotes">Named file in <code>$GIT_DIR/remotes</code></h3> |
| 1423 | <div class="paragraph"> |
| 1424 | <p>You can choose to provide the name of a |
| 1425 | file in <code>$GIT_DIR/remotes</code>. The URL |
| 1426 | in this file will be used to access the repository. The refspec |
| 1427 | in this file will be used as default when you do not |
| 1428 | provide a refspec on the command line. This file should have the |
| 1429 | following format:</p> |
| 1430 | </div> |
| 1431 | <div class="listingblock"> |
| 1432 | <div class="content"> |
| 1433 | <pre> URL: one of the above URL formats |
| 1434 | Push: <refspec> |
| 1435 | Pull: <refspec></pre> |
| 1436 | </div> |
| 1437 | </div> |
| 1438 | <div class="paragraph"> |
| 1439 | <p><code>Push:</code> lines are used by <em>git push</em> and |
| 1440 | <code>Pull:</code> lines are used by <em>git pull</em> and <em>git fetch</em>. |
| 1441 | Multiple <code>Push:</code> and <code>Pull:</code> lines may |
| 1442 | be specified for additional branch mappings.</p> |
| 1443 | </div> |
| 1444 | </div> |
| 1445 | <div class="sect2"> |
| 1446 | <h3 id="_named_file_in_git_dirbranches">Named file in <code>$GIT_DIR/branches</code></h3> |
| 1447 | <div class="paragraph"> |
| 1448 | <p>You can choose to provide the name of a |
| 1449 | file in <code>$GIT_DIR/branches</code>. |
| 1450 | The URL in this file will be used to access the repository. |
| 1451 | This file should have the following format:</p> |
| 1452 | </div> |
| 1453 | <div class="listingblock"> |
| 1454 | <div class="content"> |
| 1455 | <pre> <URL>#<head></pre> |
| 1456 | </div> |
| 1457 | </div> |
| 1458 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1459 | <p><em><URL></em> is required; #<em><head></em> is optional.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1460 | </div> |
| 1461 | <div class="paragraph"> |
| 1462 | <p>Depending on the operation, git will use one of the following |
| 1463 | refspecs, if you don’t provide one on the command line. |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1464 | <em><branch></em> is the name of this file in <code>$GIT_DIR/branches</code> and |
| 1465 | <em><head></em> defaults to <code>master</code>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1466 | </div> |
| 1467 | <div class="paragraph"> |
| 1468 | <p>git fetch uses:</p> |
| 1469 | </div> |
| 1470 | <div class="listingblock"> |
| 1471 | <div class="content"> |
| 1472 | <pre> refs/heads/<head>:refs/heads/<branch></pre> |
| 1473 | </div> |
| 1474 | </div> |
| 1475 | <div class="paragraph"> |
| 1476 | <p>git push uses:</p> |
| 1477 | </div> |
| 1478 | <div class="listingblock"> |
| 1479 | <div class="content"> |
| 1480 | <pre> HEAD:refs/heads/<head></pre> |
| 1481 | </div> |
| 1482 | </div> |
| 1483 | </div> |
| 1484 | </div> |
| 1485 | </div> |
| 1486 | <div class="sect1"> |
| 1487 | <h2 id="_merge_strategies">MERGE STRATEGIES</h2> |
| 1488 | <div class="sectionbody"> |
| 1489 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1490 | <p>The merge mechanism (<code>git</code> <code>merge</code> and <code>git</code> <code>pull</code> commands) allows the |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1491 | backend <em>merge strategies</em> to be chosen with <code>-s</code> option. Some strategies |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1492 | can also take their own options, which can be passed by giving <code>-X</code><em><option></em> |
| 1493 | arguments to <code>git</code> <code>merge</code> and/or <code>git</code> <code>pull</code>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1494 | </div> |
| 1495 | <div class="dlist"> |
| 1496 | <dl> |
| 1497 | <dt class="hdlist1">ort</dt> |
| 1498 | <dd> |
| 1499 | <p>This is the default merge strategy when pulling or merging one |
| 1500 | branch. This strategy can only resolve two heads using a |
| 1501 | 3-way merge algorithm. When there is more than one common |
| 1502 | ancestor that can be used for 3-way merge, it creates a merged |
| 1503 | tree of the common ancestors and uses that as the reference |
| 1504 | tree for the 3-way merge. This has been reported to result in |
| 1505 | fewer merge conflicts without causing mismerges by tests done |
| 1506 | on actual merge commits taken from Linux 2.6 kernel |
| 1507 | development history. Additionally this strategy can detect |
| 1508 | and handle merges involving renames. It does not make use of |
| 1509 | detected copies. The name for this algorithm is an acronym |
| 1510 | ("Ostensibly Recursive’s Twin") and came from the fact that it |
| 1511 | was written as a replacement for the previous default |
| 1512 | algorithm, <code>recursive</code>.</p> |
| 1513 | <div class="paragraph"> |
| 1514 | <p>The <em>ort</em> strategy can take the following options:</p> |
| 1515 | </div> |
| 1516 | <div class="dlist"> |
| 1517 | <dl> |
| 1518 | <dt class="hdlist1">ours</dt> |
| 1519 | <dd> |
| 1520 | <p>This option forces conflicting hunks to be auto-resolved cleanly by |
| 1521 | favoring <em>our</em> version. Changes from the other tree that do not |
| 1522 | conflict with our side are reflected in the merge result. |
| 1523 | For a binary file, the entire contents are taken from our side.</p> |
| 1524 | <div class="paragraph"> |
| 1525 | <p>This should not be confused with the <em>ours</em> merge strategy, which does not |
| 1526 | even look at what the other tree contains at all. It discards everything |
| 1527 | the other tree did, declaring <em>our</em> history contains all that happened in it.</p> |
| 1528 | </div> |
| 1529 | </dd> |
| 1530 | <dt class="hdlist1">theirs</dt> |
| 1531 | <dd> |
| 1532 | <p>This is the opposite of <em>ours</em>; note that, unlike <em>ours</em>, there is |
| 1533 | no <em>theirs</em> merge strategy to confuse this merge option with.</p> |
| 1534 | </dd> |
| 1535 | <dt class="hdlist1">ignore-space-change</dt> |
| 1536 | <dt class="hdlist1">ignore-all-space</dt> |
| 1537 | <dt class="hdlist1">ignore-space-at-eol</dt> |
| 1538 | <dt class="hdlist1">ignore-cr-at-eol</dt> |
| 1539 | <dd> |
| 1540 | <p>Treats lines with the indicated type of whitespace change as |
| 1541 | unchanged for the sake of a three-way merge. Whitespace |
| 1542 | changes mixed with other changes to a line are not ignored. |
| 1543 | See also <a href="git-diff.html">git-diff(1)</a> <code>-b</code>, <code>-w</code>, |
| 1544 | <code>--ignore-space-at-eol</code>, and <code>--ignore-cr-at-eol</code>.</p> |
| 1545 | <div class="ulist"> |
| 1546 | <ul> |
| 1547 | <li> |
| 1548 | <p>If <em>their</em> version only introduces whitespace changes to a line, |
| 1549 | <em>our</em> version is used;</p> |
| 1550 | </li> |
| 1551 | <li> |
| 1552 | <p>If <em>our</em> version introduces whitespace changes but <em>their</em> |
| 1553 | version includes a substantial change, <em>their</em> version is used;</p> |
| 1554 | </li> |
| 1555 | <li> |
| 1556 | <p>Otherwise, the merge proceeds in the usual way.</p> |
| 1557 | </li> |
| 1558 | </ul> |
| 1559 | </div> |
| 1560 | </dd> |
| 1561 | <dt class="hdlist1">renormalize</dt> |
| 1562 | <dd> |
| 1563 | <p>This runs a virtual check-out and check-in of all three stages |
| 1564 | of a file when resolving a three-way merge. This option is |
| 1565 | meant to be used when merging branches with different clean |
| 1566 | filters or end-of-line normalization rules. See "Merging |
| 1567 | branches with differing checkin/checkout attributes" in |
| 1568 | <a href="gitattributes.html">gitattributes(5)</a> for details.</p> |
| 1569 | </dd> |
| 1570 | <dt class="hdlist1">no-renormalize</dt> |
| 1571 | <dd> |
| 1572 | <p>Disables the <code>renormalize</code> option. This overrides the |
| 1573 | <code>merge.renormalize</code> configuration variable.</p> |
| 1574 | </dd> |
| 1575 | <dt class="hdlist1">find-renames[=<n>]</dt> |
| 1576 | <dd> |
| 1577 | <p>Turn on rename detection, optionally setting the similarity |
| 1578 | threshold. This is the default. This overrides the |
| 1579 | <em>merge.renames</em> configuration variable. |
| 1580 | See also <a href="git-diff.html">git-diff(1)</a> <code>--find-renames</code>.</p> |
| 1581 | </dd> |
| 1582 | <dt class="hdlist1">rename-threshold=<n></dt> |
| 1583 | <dd> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1584 | <p>Deprecated synonym for <code>find-renames=</code><em><n></em>.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1585 | </dd> |
| 1586 | <dt class="hdlist1">subtree[=<path>]</dt> |
| 1587 | <dd> |
| 1588 | <p>This option is a more advanced form of <em>subtree</em> strategy, where |
| 1589 | the strategy makes a guess on how two trees must be shifted to |
| 1590 | match with each other when merging. Instead, the specified path |
| 1591 | is prefixed (or stripped from the beginning) to make the shape of |
| 1592 | two trees to match.</p> |
| 1593 | </dd> |
| 1594 | </dl> |
| 1595 | </div> |
| 1596 | </dd> |
| 1597 | <dt class="hdlist1">recursive</dt> |
| 1598 | <dd> |
| 1599 | <p>This can only resolve two heads using a 3-way merge |
| 1600 | algorithm. When there is more than one common |
| 1601 | ancestor that can be used for 3-way merge, it creates a |
| 1602 | merged tree of the common ancestors and uses that as |
| 1603 | the reference tree for the 3-way merge. This has been |
| 1604 | reported to result in fewer merge conflicts without |
| 1605 | causing mismerges by tests done on actual merge commits |
| 1606 | taken from Linux 2.6 kernel development history. |
| 1607 | Additionally this can detect and handle merges involving |
| 1608 | renames. It does not make use of detected copies. This was |
| 1609 | the default strategy for resolving two heads from Git v0.99.9k |
| 1610 | until v2.33.0.</p> |
| 1611 | <div class="paragraph"> |
| 1612 | <p>The <em>recursive</em> strategy takes the same options as <em>ort</em>. However, |
| 1613 | there are three additional options that <em>ort</em> ignores (not documented |
| 1614 | above) that are potentially useful with the <em>recursive</em> strategy:</p> |
| 1615 | </div> |
| 1616 | <div class="dlist"> |
| 1617 | <dl> |
| 1618 | <dt class="hdlist1">patience</dt> |
| 1619 | <dd> |
| 1620 | <p>Deprecated synonym for <code>diff-algorithm=patience</code>.</p> |
| 1621 | </dd> |
| 1622 | <dt class="hdlist1">diff-algorithm=[patience|minimal|histogram|myers]</dt> |
| 1623 | <dd> |
| 1624 | <p>Use a different diff algorithm while merging, which can help |
| 1625 | avoid mismerges that occur due to unimportant matching lines |
| 1626 | (such as braces from distinct functions). See also |
| 1627 | <a href="git-diff.html">git-diff(1)</a> <code>--diff-algorithm</code>. Note that <code>ort</code> |
| 1628 | specifically uses <code>diff-algorithm=histogram</code>, while <code>recursive</code> |
| 1629 | defaults to the <code>diff.algorithm</code> config setting.</p> |
| 1630 | </dd> |
| 1631 | <dt class="hdlist1">no-renames</dt> |
| 1632 | <dd> |
| 1633 | <p>Turn off rename detection. This overrides the <code>merge.renames</code> |
| 1634 | configuration variable. |
| 1635 | See also <a href="git-diff.html">git-diff(1)</a> <code>--no-renames</code>.</p> |
| 1636 | </dd> |
| 1637 | </dl> |
| 1638 | </div> |
| 1639 | </dd> |
| 1640 | <dt class="hdlist1">resolve</dt> |
| 1641 | <dd> |
| 1642 | <p>This can only resolve two heads (i.e. the current branch |
| 1643 | and another branch you pulled from) using a 3-way merge |
| 1644 | algorithm. It tries to carefully detect criss-cross |
| 1645 | merge ambiguities. It does not handle renames.</p> |
| 1646 | </dd> |
| 1647 | <dt class="hdlist1">octopus</dt> |
| 1648 | <dd> |
| 1649 | <p>This resolves cases with more than two heads, but refuses to do |
| 1650 | a complex merge that needs manual resolution. It is |
| 1651 | primarily meant to be used for bundling topic branch |
| 1652 | heads together. This is the default merge strategy when |
| 1653 | pulling or merging more than one branch.</p> |
| 1654 | </dd> |
| 1655 | <dt class="hdlist1">ours</dt> |
| 1656 | <dd> |
| 1657 | <p>This resolves any number of heads, but the resulting tree of the |
| 1658 | merge is always that of the current branch head, effectively |
| 1659 | ignoring all changes from all other branches. It is meant to |
| 1660 | be used to supersede old development history of side |
| 1661 | branches. Note that this is different from the -Xours option to |
| 1662 | the <em>recursive</em> merge strategy.</p> |
| 1663 | </dd> |
| 1664 | <dt class="hdlist1">subtree</dt> |
| 1665 | <dd> |
| 1666 | <p>This is a modified <code>ort</code> strategy. When merging trees A and |
| 1667 | B, if B corresponds to a subtree of A, B is first adjusted to |
| 1668 | match the tree structure of A, instead of reading the trees at |
| 1669 | the same level. This adjustment is also done to the common |
| 1670 | ancestor tree.</p> |
| 1671 | </dd> |
| 1672 | </dl> |
| 1673 | </div> |
| 1674 | <div class="paragraph"> |
| 1675 | <p>With the strategies that use 3-way merge (including the default, <em>ort</em>), |
| 1676 | if a change is made on both branches, but later reverted on one of the |
| 1677 | branches, that change will be present in the merged result; some people find |
| 1678 | this behavior confusing. It occurs because only the heads and the merge base |
| 1679 | are considered when performing a merge, not the individual commits. The merge |
| 1680 | algorithm therefore considers the reverted change as no change at all, and |
| 1681 | substitutes the changed version instead.</p> |
| 1682 | </div> |
| 1683 | </div> |
| 1684 | </div> |
| 1685 | <div class="sect1"> |
| 1686 | <h2 id="_default_behaviour">DEFAULT BEHAVIOUR</h2> |
| 1687 | <div class="sectionbody"> |
| 1688 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1689 | <p>Often people use <code>git</code> <code>pull</code> without giving any parameter. |
| 1690 | Traditionally, this has been equivalent to saying <code>git</code> <code>pull</code> |
| 1691 | <code>origin</code>. However, when configuration <code>branch.</code><em><name></em><code>.remote</code> is |
| 1692 | present while on branch <em><name></em>, that value is used instead of |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1693 | <code>origin</code>.</p> |
| 1694 | </div> |
| 1695 | <div class="paragraph"> |
| 1696 | <p>In order to determine what URL to use to fetch from, the value |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1697 | of the configuration <code>remote.</code><em><origin></em><code>.url</code> is consulted |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1698 | and if there is not any such variable, the value on the <code>URL:</code> line |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1699 | in <code>$GIT_DIR/remotes/</code><em><origin></em> is used.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1700 | </div> |
| 1701 | <div class="paragraph"> |
| 1702 | <p>In order to determine what remote branches to fetch (and |
| 1703 | optionally store in the remote-tracking branches) when the command is |
| 1704 | run without any refspec parameters on the command line, values |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1705 | of the configuration variable <code>remote.</code><em><origin></em><code>.fetch</code> are |
| 1706 | consulted, and if there aren’t any, <code>$GIT_DIR/remotes/</code><em><origin></em> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1707 | is consulted and its <code>Pull:</code> lines are used. |
| 1708 | In addition to the refspec formats described in the OPTIONS |
| 1709 | section, you can have a globbing refspec that looks like this:</p> |
| 1710 | </div> |
| 1711 | <div class="listingblock"> |
| 1712 | <div class="content"> |
| 1713 | <pre>refs/heads/*:refs/remotes/origin/*</pre> |
| 1714 | </div> |
| 1715 | </div> |
| 1716 | <div class="paragraph"> |
| 1717 | <p>A globbing refspec must have a non-empty RHS (i.e. must store |
| 1718 | what were fetched in remote-tracking branches), and its LHS and RHS |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1719 | must end with <code>/</code>*. The above specifies that all remote |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1720 | branches are tracked using remote-tracking branches in |
| 1721 | <code>refs/remotes/origin/</code> hierarchy under the same name.</p> |
| 1722 | </div> |
| 1723 | <div class="paragraph"> |
| 1724 | <p>The rule to determine which remote branch to merge after |
| 1725 | fetching is a bit involved, in order not to break backward |
| 1726 | compatibility.</p> |
| 1727 | </div> |
| 1728 | <div class="paragraph"> |
| 1729 | <p>If explicit refspecs were given on the command |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1730 | line of <code>git</code> <code>pull</code>, they are all merged.</p> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1731 | </div> |
| 1732 | <div class="paragraph"> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1733 | <p>When no refspec was given on the command line, then <code>git</code> <code>pull</code> |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1734 | uses the refspec from the configuration or |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1735 | <code>$GIT_DIR/remotes/</code><em><origin></em>. In such cases, the following |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1736 | rules apply:</p> |
| 1737 | </div> |
| 1738 | <div class="olist arabic"> |
| 1739 | <ol class="arabic"> |
| 1740 | <li> |
Junio C Hamano | dc39238 | 2024-10-11 18:57:29 | [diff] [blame] | 1741 | <p>If <code>branch.</code><em><name></em><code>.merge</code> configuration for the current |
| 1742 | branch <em><name></em> exists, that is the name of the branch at the |
Junio C Hamano | b96f40a | 2024-08-01 00:57:25 | [diff] [blame] | 1743 | remote site that is merged.</p> |
| 1744 | </li> |
| 1745 | <li> |
| 1746 | <p>If the refspec is a globbing one, nothing is merged.</p> |
| 1747 | </li> |
| 1748 | <li> |
| 1749 | <p>Otherwise the remote branch of the first refspec is merged.</p> |
| 1750 | </li> |
| 1751 | </ol> |
| 1752 | </div> |
| 1753 | </div> |
| 1754 | </div> |
| 1755 | <div class="sect1"> |
| 1756 | <h2 id="_examples">EXAMPLES</h2> |
| 1757 | <div class="sectionbody"> |
| 1758 | <div class="ulist"> |
| 1759 | <ul> |
| 1760 | <li> |
| 1761 | <p>Update the remote-tracking branches for the repository |
| 1762 | you cloned from, then merge one of them into your |
| 1763 | current branch:</p> |
| 1764 | <div class="listingblock"> |
| 1765 | <div class="content"> |
| 1766 | <pre>$ git pull |
| 1767 | $ git pull origin</pre> |
| 1768 | </div> |
| 1769 | </div> |
| 1770 | <div class="paragraph"> |
| 1771 | <p>Normally the branch merged in is the HEAD of the remote repository, |
| 1772 | but the choice is determined by the branch.<name>.remote and |
| 1773 | branch.<name>.merge options; see <a href="git-config.html">git-config(1)</a> for details.</p> |
| 1774 | </div> |
| 1775 | </li> |
| 1776 | <li> |
| 1777 | <p>Merge into the current branch the remote branch <code>next</code>:</p> |
| 1778 | <div class="listingblock"> |
| 1779 | <div class="content"> |
| 1780 | <pre>$ git pull origin next</pre> |
| 1781 | </div> |
| 1782 | </div> |
| 1783 | <div class="paragraph"> |
| 1784 | <p>This leaves a copy of <code>next</code> temporarily in FETCH_HEAD, and |
| 1785 | updates the remote-tracking branch <code>origin/next</code>. |
| 1786 | The same can be done by invoking fetch and merge:</p> |
| 1787 | </div> |
| 1788 | <div class="listingblock"> |
| 1789 | <div class="content"> |
| 1790 | <pre>$ git fetch origin |
| 1791 | $ git merge origin/next</pre> |
| 1792 | </div> |
| 1793 | </div> |
| 1794 | </li> |
| 1795 | </ul> |
| 1796 | </div> |
| 1797 | <div class="paragraph"> |
| 1798 | <p>If you tried a pull which resulted in complex conflicts and |
| 1799 | would want to start over, you can recover with <em>git reset</em>.</p> |
| 1800 | </div> |
| 1801 | </div> |
| 1802 | </div> |
| 1803 | <div class="sect1"> |
| 1804 | <h2 id="_security">SECURITY</h2> |
| 1805 | <div class="sectionbody"> |
| 1806 | <div class="paragraph"> |
| 1807 | <p>The fetch and push protocols are not designed to prevent one side from |
| 1808 | stealing data from the other repository that was not intended to be |
| 1809 | shared. If you have private data that you need to protect from a malicious |
| 1810 | peer, your best option is to store it in another repository. This applies |
| 1811 | to both clients and servers. In particular, namespaces on a server are not |
| 1812 | effective for read access control; you should only grant read access to a |
| 1813 | namespace to clients that you would trust with read access to the entire |
| 1814 | repository.</p> |
| 1815 | </div> |
| 1816 | <div class="paragraph"> |
| 1817 | <p>The known attack vectors are as follows:</p> |
| 1818 | </div> |
| 1819 | <div class="olist arabic"> |
| 1820 | <ol class="arabic"> |
| 1821 | <li> |
| 1822 | <p>The victim sends "have" lines advertising the IDs of objects it has that |
| 1823 | are not explicitly intended to be shared but can be used to optimize the |
| 1824 | transfer if the peer also has them. The attacker chooses an object ID X |
| 1825 | to steal and sends a ref to X, but isn’t required to send the content of |
| 1826 | X because the victim already has it. Now the victim believes that the |
| 1827 | attacker has X, and it sends the content of X back to the attacker |
| 1828 | later. (This attack is most straightforward for a client to perform on a |
| 1829 | server, by creating a ref to X in the namespace the client has access |
| 1830 | to and then fetching it. The most likely way for a server to perform it |
| 1831 | on a client is to "merge" X into a public branch and hope that the user |
| 1832 | does additional work on this branch and pushes it back to the server |
| 1833 | without noticing the merge.)</p> |
| 1834 | </li> |
| 1835 | <li> |
| 1836 | <p>As in #1, the attacker chooses an object ID X to steal. The victim sends |
| 1837 | an object Y that the attacker already has, and the attacker falsely |
| 1838 | claims to have X and not Y, so the victim sends Y as a delta against X. |
| 1839 | The delta reveals regions of X that are similar to Y to the attacker.</p> |
| 1840 | </li> |
| 1841 | </ol> |
| 1842 | </div> |
| 1843 | </div> |
| 1844 | </div> |
| 1845 | <div class="sect1"> |
| 1846 | <h2 id="_bugs">BUGS</h2> |
| 1847 | <div class="sectionbody"> |
| 1848 | <div class="paragraph"> |
| 1849 | <p>Using --recurse-submodules can only fetch new commits in already checked |
| 1850 | out submodules right now. When e.g. upstream added a new submodule in the |
| 1851 | just fetched commits of the superproject the submodule itself cannot be |
| 1852 | fetched, making it impossible to check out that submodule later without |
| 1853 | having to do a fetch again. This is expected to be fixed in a future Git |
| 1854 | version.</p> |
| 1855 | </div> |
| 1856 | </div> |
| 1857 | </div> |
| 1858 | <div class="sect1"> |
| 1859 | <h2 id="_see_also">SEE ALSO</h2> |
| 1860 | <div class="sectionbody"> |
| 1861 | <div class="paragraph"> |
| 1862 | <p><a href="git-fetch.html">git-fetch(1)</a>, <a href="git-merge.html">git-merge(1)</a>, <a href="git-config.html">git-config(1)</a></p> |
| 1863 | </div> |
| 1864 | </div> |
| 1865 | </div> |
| 1866 | <div class="sect1"> |
| 1867 | <h2 id="_git">GIT</h2> |
| 1868 | <div class="sectionbody"> |
| 1869 | <div class="paragraph"> |
| 1870 | <p>Part of the <a href="git.html">git(1)</a> suite</p> |
| 1871 | </div> |
| 1872 | </div> |
| 1873 | </div> |
| 1874 | </div> |
| 1875 | <div id="footer"> |
| 1876 | <div id="footer-text"> |
| 1877 | Last updated 2024-03-25 17:24:49 -0700 |
| 1878 | </div> |
| 1879 | </div> |
| 1880 | </body> |
| 1881 | </html> |