GIT-Tutorial.html 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
  5. <title>GIT-Tutorial</title><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:"Lucida Console",Consolas,"Courier",monospace; }
  6. html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
  7. body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; }
  8. iframe { margin: auto; }
  9. a.url { word-break: break-all; }
  10. a:active, a:hover { outline: 0px; }
  11. .in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
  12. #write { margin: 0px auto; height: auto; width: inherit; word-break: normal; word-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 40px; }
  13. #write.first-line-indent p { text-indent: 2em; }
  14. #write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
  15. #write.first-line-indent li { margin-left: 2em; }
  16. .for-image #write { padding-left: 8px; padding-right: 8px; }
  17. body.typora-export { padding-left: 30px; padding-right: 30px; }
  18. .typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
  19. @media screen and (max-width: 500px) {
  20. body.typora-export { padding-left: 0px; padding-right: 0px; }
  21. .CodeMirror-sizer { margin-left: 0px !important; }
  22. .CodeMirror-gutters { display: none !important; }
  23. }
  24. #write li > figure:first-child { margin-top: -20px; }
  25. #write ol, #write ul { position: relative; }
  26. img { max-width: 100%; vertical-align: middle; }
  27. button, input, select, textarea { color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; }
  28. input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
  29. *, ::after, ::before { box-sizing: border-box; }
  30. #write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
  31. #write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
  32. h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 2; }
  33. p { orphans: 4; }
  34. h1 { font-size: 2rem; }
  35. h2 { font-size: 1.8rem; }
  36. h3 { font-size: 1.6rem; }
  37. h4 { font-size: 1.4rem; }
  38. h5 { font-size: 1.2rem; }
  39. h6 { font-size: 1rem; }
  40. .md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
  41. .hidden { display: none; }
  42. .md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
  43. a { cursor: pointer; }
  44. sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
  45. sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
  46. #write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
  47. figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
  48. figure > table { margin: 0px !important; }
  49. tr { break-inside: avoid; break-after: auto; }
  50. thead { display: table-header-group; }
  51. table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
  52. table.md-table td { min-width: 32px; }
  53. .CodeMirror-gutters { border-right: 0px; background-color: inherit; }
  54. .CodeMirror { text-align: left; }
  55. .CodeMirror-placeholder { opacity: 0.3; }
  56. .CodeMirror pre { padding: 0px 4px; }
  57. .CodeMirror-lines { padding: 0px; }
  58. div.hr:focus { cursor: none; }
  59. #write pre { white-space: pre-wrap; }
  60. #write.fences-no-line-wrapping pre { white-space: pre; }
  61. #write pre.ty-contain-cm { white-space: normal; }
  62. .CodeMirror-gutters { margin-right: 4px; }
  63. .md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
  64. .md-diagram-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
  65. #write .md-fences.mock-cm { white-space: pre-wrap; }
  66. .md-fences.md-fences-with-lineno { padding-left: 0px; }
  67. #write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
  68. .md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
  69. .CodeMirror-line, twitterwidget { break-inside: avoid; }
  70. .footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
  71. .footnotes + .footnotes { margin-top: 0px; }
  72. .md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }
  73. li div { padding-top: 0px; }
  74. blockquote { margin: 1rem 0px; }
  75. li .mathjax-block, li p { margin: 0.5rem 0px; }
  76. li { margin: 0px; position: relative; }
  77. blockquote > :last-child { margin-bottom: 0px; }
  78. blockquote > :first-child, li > :first-child { margin-top: 0px; }
  79. .footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
  80. #write .footnote-line { white-space: pre-wrap; }
  81. @media print {
  82. body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; }
  83. #write { margin-top: 0px; padding-top: 0px; border-color: transparent !important; }
  84. .typora-export * { -webkit-print-color-adjust: exact; }
  85. html.blink-to-pdf { font-size: 13px; }
  86. .typora-export #write { padding-left: 32px; padding-right: 32px; padding-bottom: 0px; break-after: avoid; }
  87. .typora-export #write::after { height: 0px; }
  88. @page { margin: 20mm 0px; }
  89. }
  90. .footnote-line { margin-top: 0.714em; font-size: 0.7em; }
  91. a img, img a { cursor: pointer; }
  92. pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
  93. p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
  94. p > .md-image:only-child { display: inline-block; width: 100%; }
  95. #write .MathJax_Display { margin: 0.8em 0px 0px; }
  96. .md-math-block { width: 100%; }
  97. .md-math-block:not(:empty)::after { display: none; }
  98. [contenteditable="true"]:active, [contenteditable="true"]:focus { outline: 0px; box-shadow: none; }
  99. .md-task-list-item { position: relative; list-style-type: none; }
  100. .task-list-item.md-task-list-item { padding-left: 0px; }
  101. .md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); }
  102. .math { font-size: 1rem; }
  103. .md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
  104. .md-toc-content { position: relative; margin-left: 0px; }
  105. .md-toc-content::after, .md-toc::after { display: none; }
  106. .md-toc-item { display: block; color: rgb(65, 131, 196); }
  107. .md-toc-item a { text-decoration: none; }
  108. .md-toc-inner:hover { text-decoration: underline; }
  109. .md-toc-inner { display: inline-block; cursor: pointer; }
  110. .md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
  111. .md-toc-h2 .md-toc-inner { margin-left: 2em; }
  112. .md-toc-h3 .md-toc-inner { margin-left: 4em; }
  113. .md-toc-h4 .md-toc-inner { margin-left: 6em; }
  114. .md-toc-h5 .md-toc-inner { margin-left: 8em; }
  115. .md-toc-h6 .md-toc-inner { margin-left: 10em; }
  116. @media screen and (max-width: 48em) {
  117. .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
  118. .md-toc-h4 .md-toc-inner { margin-left: 5em; }
  119. .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
  120. .md-toc-h6 .md-toc-inner { margin-left: 8em; }
  121. }
  122. a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
  123. .footnote-line a:not(.reversefootnote) { color: inherit; }
  124. .md-attr { display: none; }
  125. .md-fn-count::after { content: "."; }
  126. code, pre, samp, tt { font-family: var(--monospace); }
  127. kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
  128. .md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: var(--monospace); }
  129. code { text-align: left; vertical-align: initial; }
  130. a.md-print-anchor { white-space: pre !important; border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
  131. .md-inline-math .MathJax_SVG .noError { display: none !important; }
  132. .html-for-mac .inline-math-svg .MathJax_SVG { vertical-align: 0.2px; }
  133. .md-math-block .MathJax_SVG_Display { text-align: center; margin: 0px; position: relative; text-indent: 0px; max-width: none; max-height: none; min-height: 0px; min-width: 100%; width: auto; overflow-y: hidden; display: block !important; }
  134. .MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
  135. .MathJax_SVG .MJX-monospace { font-family: var(--monospace); }
  136. .MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
  137. .MathJax_SVG { display: inline; font-style: normal; font-weight: 400; line-height: normal; zoom: 90%; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; }
  138. .MathJax_SVG * { transition: none; }
  139. .MathJax_SVG_Display svg { vertical-align: middle !important; margin-bottom: 0px !important; }
  140. .os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
  141. .md-diagram-panel > svg { max-width: 100%; }
  142. [lang="mermaid"] svg, [lang="flow"] svg { max-width: 100%; }
  143. [lang="mermaid"] .node text { font-size: 1rem; }
  144. table tr th { border-bottom: 0px; }
  145. video { max-width: 100%; display: block; margin: 0px auto; }
  146. iframe { max-width: 100%; width: 100%; border: none; }
  147. .highlight td, .highlight tr { border: 0px; }
  148. .CodeMirror { height: auto; }
  149. .CodeMirror.cm-s-inner { background: inherit; }
  150. .CodeMirror-scroll { overflow-y: hidden; overflow-x: auto; z-index: 3; }
  151. .CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
  152. .CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; }
  153. .CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
  154. .cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
  155. .cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
  156. .cm-s-inner .cm-number { color: rgb(17, 102, 68); }
  157. .cm-s-inner .cm-def { color: rgb(0, 0, 255); }
  158. .cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
  159. .cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
  160. .cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
  161. .cm-s-inner .cm-string { color: rgb(170, 17, 17); }
  162. .cm-s-inner .cm-property { color: rgb(0, 0, 0); }
  163. .cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
  164. .cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
  165. .cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
  166. .cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
  167. .cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
  168. .cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
  169. .cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
  170. .cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
  171. .cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
  172. .cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
  173. .cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
  174. .cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
  175. .cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
  176. .cm-negative { color: rgb(221, 68, 68); }
  177. .cm-positive { color: rgb(34, 153, 34); }
  178. .cm-header, .cm-strong { font-weight: 700; }
  179. .cm-del { text-decoration: line-through; }
  180. .cm-em { font-style: italic; }
  181. .cm-link { text-decoration: underline; }
  182. .cm-error { color: red; }
  183. .cm-invalidchar { color: red; }
  184. .cm-constant { color: rgb(38, 139, 210); }
  185. .cm-defined { color: rgb(181, 137, 0); }
  186. div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
  187. div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
  188. .cm-s-inner .CodeMirror-activeline-background { background: inherit; }
  189. .CodeMirror { position: relative; overflow: hidden; }
  190. .CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; }
  191. .CodeMirror-sizer { position: relative; }
  192. .CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; }
  193. .CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
  194. .CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: hidden; }
  195. .CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
  196. .CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
  197. .CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 30px; z-index: 3; }
  198. .CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
  199. .CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
  200. .CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
  201. .CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
  202. .CodeMirror-lines { cursor: text; }
  203. .CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; word-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
  204. .CodeMirror-wrap pre { word-wrap: break-word; white-space: pre-wrap; word-break: normal; }
  205. .CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
  206. .CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
  207. .CodeMirror-linebackground { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; z-index: 0; }
  208. .CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
  209. .CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
  210. .CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
  211. .CodeMirror-measure pre { position: static; }
  212. .CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
  213. .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
  214. .CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
  215. .cm-searching { background: rgba(255, 255, 0, 0.4); }
  216. @media print {
  217. .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
  218. }
  219. :root { --control-text-color: #777; --side-bar-bg-color: #f6f8fa; }
  220. html { font-size: 16px; -webkit-font-smoothing: subpixel-antialiased; }
  221. body { font-family: "SF UI Text", "PingFang SC", -apple-system, -apple-system-body, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", 微软雅黑, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; color: rgb(36, 41, 46); line-height: 1.5; font-weight: 300; }
  222. #write { max-width: 860px; margin: 0px auto; padding: 20px 30px 100px; }
  223. #write > ul:first-child, #write > ol:first-child { margin-top: 30px; }
  224. body > :first-child { margin-top: 0px !important; }
  225. body > :last-child { margin-bottom: 0px !important; }
  226. a { color: rgb(65, 131, 196); }
  227. h1, h2, h3, h4, h5, h6 { position: relative; margin-top: 1.8rem; margin-bottom: 1rem; font-weight: 400; line-height: 1.4; cursor: text; color: rgb(20, 35, 49); }
  228. h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { text-decoration: none; }
  229. h1 tt, h1 code { font-size: inherit; }
  230. h2 tt, h2 code { font-size: inherit; }
  231. h3 tt, h3 code { font-size: inherit; }
  232. h4 tt, h4 code { font-size: inherit; }
  233. h5 tt, h5 code { font-size: inherit; }
  234. h6 tt, h6 code { font-size: inherit; }
  235. h1 { text-align: center; padding-bottom: 0.3em; font-size: 2.25em; line-height: 1.2; margin: 1em auto 1.2em; font-weight: 300; }
  236. h1::after { border-bottom: 2px dashed rgb(175, 236, 158); content: ""; width: 100px; display: block; margin: 0.2em auto 0px; height: 2px; }
  237. h2 { font-size: 1.75em; padding-left: 9px; line-height: 1.4; border-left: 6px solid rgb(204, 229, 255); }
  238. h3 { font-size: 1.5em; line-height: 1.43; }
  239. h3::before { border-radius: 50%; background-color: rgb(158, 208, 255); content: ""; width: 6px; display: inline-block; height: 6px; vertical-align: middle; margin-bottom: 0.18em; margin-right: 8px; }
  240. #write > h3.md-focus::before, #write > h4.md-focus::before { background-color: transparent; width: auto; height: auto; }
  241. h4 { font-size: 1.25em; }
  242. h4::before { background-color: rgb(158, 208, 255); content: ""; width: 6px; display: inline-block; height: 2px; vertical-align: middle; margin-bottom: 0.18em; margin-right: 8px; }
  243. h5 { font-size: 1em; }
  244. h6 { font-size: 1em; color: rgb(119, 119, 119); }
  245. p, blockquote, ul, ol, dl, table { margin: 0.8em 0px; }
  246. li > ol, li > ul { margin: 0px; }
  247. hr { height: 0.25em; padding: 0px; margin: 24px 0px; background-color: rgb(225, 228, 232); border: 0px; }
  248. body > h2:first-child { margin-top: 0px; padding-top: 0px; }
  249. body > h1:first-child { margin-top: 0px; padding-top: 0px; }
  250. body > h1:first-child + h2 { margin-top: 0px; padding-top: 0px; }
  251. body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child { margin-top: 0px; padding-top: 0px; }
  252. a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { margin-top: 0px; padding-top: 0px; }
  253. h1 p, h2 p, h3 p, h4 p, h5 p, h6 p { margin-top: 0px; }
  254. li p.first { display: inline-block; }
  255. ul, ol { padding-left: 30px; }
  256. ul:first-child, ol:first-child { margin-top: 0px; }
  257. ul:last-child, ol:last-child { margin-bottom: 0px; }
  258. blockquote { border-left: 4px dotted rgb(229, 232, 232); padding: 0px 12px; color: rgb(68, 68, 68); font-size: 0.9em; }
  259. blockquote blockquote { padding-right: 0px; }
  260. table { padding: 0px; word-break: initial; }
  261. table tr { border-top: 1px solid rgb(224, 224, 224); margin: 0px; padding: 0px; }
  262. table tr:nth-child(2n) { background-color: rgb(250, 250, 250); }
  263. table tr th { font-weight: 400; border: 1px solid rgb(224, 224, 224); text-align: left; margin: 0px; padding: 6px 13px; }
  264. table tr td { border: 1px solid rgb(224, 224, 224); text-align: left; margin: 0px; padding: 6px 13px; }
  265. table tr th:first-child, table tr td:first-child { margin-top: 0px; }
  266. table tr th:last-child, table tr td:last-child { margin-bottom: 0px; }
  267. .CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); }
  268. .md-fences, code, tt { font-size: 90%; border-radius: 3px; font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, Courier, monospace, "PingFang SC", "Microsoft YaHei", 微软雅黑; }
  269. code, tt { margin: 0px 2px; padding: 2px 4px; background-color: rgb(226, 240, 255); }
  270. .md-fences { background-color: rgb(246, 248, 250); margin-bottom: 15px; margin-top: 15px; padding: 12px 1em; }
  271. .md-task-list-item > input { margin-left: -1.45em; margin-top: calc(0.9em - 10px); }
  272. @media screen and (min-width: 914px) {
  273. }
  274. @media print {
  275. body { font-size: 11px; font-weight: 400; }
  276. table, pre { break-inside: avoid; }
  277. pre { word-wrap: break-word; }
  278. }
  279. #write pre.md-meta-block { padding: 1rem; font-size: 85%; line-height: 1.45; background-color: rgb(247, 250, 246); border: 0px; border-radius: 3px; color: rgb(119, 119, 119); margin-top: 0px !important; }
  280. .mathjax-block > .code-tooltip { bottom: 0.375rem; }
  281. #write > h3.md-focus::before { left: -1.5625rem; top: 0.375rem; }
  282. #write > h4.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
  283. #write > h5.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
  284. #write > h6.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
  285. .md-image > .md-meta { border: 1px solid rgb(221, 221, 221); border-radius: 3px; font-family: "SF Mono", Consolas, "PingFang SC", "Liberation Mono", Courier, monospace, "Microsoft YaHei", 微软雅黑; padding: 2px 4px 0px; font-size: 0.9em; color: inherit; }
  286. .md-tag { color: inherit; }
  287. .md-toc { margin-top: 20px; padding-bottom: 20px; }
  288. .sidebar-tabs { border-bottom: none; }
  289. #typora-quick-open { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); }
  290. #typora-quick-open-item { background-color: rgb(250, 250, 250); border-color: rgb(254, 254, 254) rgb(229, 229, 229) rgb(229, 229, 229) rgb(238, 238, 238); border-style: solid; border-width: 1px; }
  291. .typora-quick-open-item { padding-top: 3px; }
  292. .typora-quick-open-list { margin-top: 4px; }
  293. .typora-quick-open-item-path { margin-top: -2px; }
  294. #md-notification::before { top: 10px; }
  295. .on-focus-mode blockquote { border-left-color: rgba(85, 85, 85, 0.12); }
  296. header, .context-menu, .megamenu-content, footer { font-family: "SF UI Text", "PingFang SC", -apple-system, -apple-system-body, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", 微软雅黑, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; }
  297. .file-node-content:hover .file-node-icon, .file-node-content:hover .file-node-open-state { visibility: visible; }
  298. .mac-seamless-mode #typora-sidebar { background-color: var(--side-bar-bg-color); }
  299. .md-lang { color: rgb(180, 101, 77); }
  300. .pin-outline .outline-active, .pin-outline #outline-content .outline-active strong { font-weight: 400; color: rgb(35, 35, 35); }
  301. .outline-label { font-weight: 300; color: rgb(100, 100, 100); }
  302. strong, b { font-weight: 400; }
  303. .file-list-item-summary { font-family: "SF UI Text", "PingFang SC", -apple-system, -apple-system-body, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", 微软雅黑, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; }
  304. .file-list-item-file-name { font-weight: 400; }
  305. body { font-weight: 400; -webkit-font-smoothing: auto; }
  306. h1, h2, h3, h4, h5, h6 { font-weight: 500; }
  307. h1 { font-weight: 400; }
  308. .md-task-list-item > input { margin-top: calc(1em - 10px); }
  309. .pin-outline .outline-active, .pin-outline #outline-content .outline-active strong { font-weight: 500; }
  310. .outline-label { font-weight: 400; }
  311. strong, b { font-weight: 500; }
  312. .file-list-item-file-name { font-weight: 500; }
  313. .typora-export li, .typora-export p, .typora-export, .footnote-line {white-space: normal;}
  314. </style>
  315. </head>
  316. <body class='typora-export os-windows' >
  317. <div id='write' class = 'is-node'><h1><a name='header-n0' class='md-header-anchor '></a>Hitchhikers Guide to GIT</h1><p>-- eine kurze Reise durchs GIT-Universum</p><p><code>Work in Progress ! ||| Made by m0e@2019 --- E42L</code></p><div class='md-toc' mdtype='toc'><p class="md-toc-content"><span class="md-toc-item md-toc-h1" data-ref="n0"><a class="md-toc-inner" href="#header-n0">Hitchhikers Guide to GIT</a></span><span class="md-toc-item md-toc-h2" data-ref="n5"><a class="md-toc-inner" href="#header-n5">Hilfreiche Links vorab:</a></span><span class="md-toc-item md-toc-h2" data-ref="n15"><a class="md-toc-inner" href="#header-n15">Grundlegende Befehle:</a></span><span class="md-toc-item md-toc-h2" data-ref="n25"><a class="md-toc-inner" href="#header-n25">Grundlagen</a></span><span class="md-toc-item md-toc-h3" data-ref="n55"><a class="md-toc-inner" href="#header-n55">Branching</a></span><span class="md-toc-item md-toc-h3" data-ref="n66"><a class="md-toc-inner" href="#header-n66">Tags</a></span><span class="md-toc-item md-toc-h2" data-ref="n77"><a class="md-toc-inner" href="#header-n77">Aliase und Autovervollständigung</a></span><span class="md-toc-item md-toc-h3" data-ref="n78"><a class="md-toc-inner" href="#header-n78">Autocompletion</a></span><span class="md-toc-item md-toc-h3" data-ref="n80"><a class="md-toc-inner" href="#header-n80">Alias</a></span><span class="md-toc-item md-toc-h2" data-ref="n83"><a class="md-toc-inner" href="#header-n83">Reset lokal Repository</a></span><span class="md-toc-item md-toc-h2" data-ref="n88"><a class="md-toc-inner" href="#header-n88">Software (Windows oder MultiPlattform)</a></span><span class="md-toc-item md-toc-h2" data-ref="n97"><a class="md-toc-inner" href="#header-n97">Häufiger Workflow</a></span><span class="md-toc-item md-toc-h2" data-ref="n126"><a class="md-toc-inner" href="#header-n126">weitere Befehle</a></span></p></div><h2><a name='header-n5' class='md-header-anchor '></a>Hilfreiche Links vorab:</h2><p><a href='https://git-scm.com/book/de/v1/'>Offizielles GIT Buch</a> -- Sehr gut, mehrsprachig</p><p><a href='https://rogerdudler.github.io/git-guide/index.de.html'>Tutorial - kein SchnickSchnack</a> -- kurz und knackig</p><p><a href='https://www.thewebhatesme.com/entwicklung/git-fuer-einsteiger/'>Git für Einsteiger</a></p><p><a href='https://try.github.io/'>Github Playground</a> -- inkteraktive Spielwiese</p><p><a href='http://think-like-a-git.net/'>Think like (a) GIT</a></p><p><a href='http://git.enigma42.de/m0e/GIT-Tut'>Daten diese Tutorials</a> -- Repo des Tutorials</p><p><a href='https://github.com/darthm0e/Test-GIT-TUT'>Tutorial Repo</a> -- Das Beispielrepository</p><hr /><h2><a name='header-n15' class='md-header-anchor '></a>Grundlegende Befehle:</h2><p>git init</p><p>git add . || git add <filename></p><p>git commit -m &quot;grund&quot; || git commit -a -m &quot;grund&quot;</p><p>git remote add origin <a href='http://pfad.zum/repo.git' target='_blank' class='url'>http://pfad.zum/repo.git</a></p><p>git push -u origin master (master ist hier der Name des Branch, also hier der Hauptbranch)</p><p>git clone url (opt. lokalesVerzeichniss)</p><p>git clone --recursive</p><hr /><h2><a name='header-n25' class='md-header-anchor '></a>Grundlagen</h2><p>GIT ist ein relativ neues VCS (Version-Controll-System), welches im Unterschied zu vielen anderen Änderungen an Dateien und Ordnern nicht als Diffs (fortlaufende Liste der Änderung an Dateien) sondern erzeugt bei einem Commit einen Snapshot des Repository-<em>&quot;Dateisystems&quot;</em>
  318. Hierbei werden effizienter weise nur geänderte Dateien neu gespeichert. Auf unveränderte Dateien wird nur ein Verweis auf den jeweiligen Snapshot angelegt. Dieses Konzept vereinfacht unter anderem die Arbeit mit Branches (<em>Grundlagen &gt; Branching</em>).</p><p><img src='img/snapshot.png' alt='Snapshots in GIT' referrerPolicy='no-referrer' /></p><p>Lokal wird mit <code>git init</code> ein Repository erzeugt, und der Ordner <code>.git</code> angelegt. Hier liegen Konfigurationsdateien des Repositorys und weiter Daten (für uns hier unrelevant).
  319. In der Regel wird man ein Verzeichnis wählen das bereits Daten enthält. Um diese dem Repository bekannt zu machen (einchecken) führen wir den Befehl <code>git add .</code> aus. Hiermit werden alle im Verzeichnis enthaltenen Dateien und Ordner ins Repository aufgenommen. Um nur bestimmte Dateien oder Ordner aufzunehmen kann man statt des Punktes den Datei-/Ordnernamen angeben. Möglich ist auch die Angabe in Form von &quot;Wildcards&quot; um etwa alle Dateien eines Typs auzunehmen -&gt; <code>git add *.png</code> oder <code>git add GenialeDateien.*</code></p><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">~Screendump:~</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">$ git init</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Initialized empty Git repository in /mnt/c/Users/m0e/Documents/GIT/Test-GIT-TUT/.git/</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">$ git add *.md</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 126px;"></div><div class="CodeMirror-gutters" style="display: none; height: 126px;"></div></div></div></pre><p>Unsere Dateien wurden jetzt zur Versionskontrolle (Staging Area) hinzugefügt, im Git Jargon <code>staged</code> oder <code>staging</code> genannt.
  320. mit <code>git status</code> zeigt uns GIT diesen Zustand auch an:</p><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">~Screendump:~</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">$ git status</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">On branch master</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Initial commit</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Changes to be committed:</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> (use "git rm --cached &lt;file&gt;..." to unstage)</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; new file: &nbsp; README.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; new file: &nbsp; Test.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 273px;"></div><div class="CodeMirror-gutters" style="display: none; height: 273px;"></div></div></div></pre><p>Nachdem nun alle Dateien in der Staging Area gesammelt sind können wir einen Commit ausführen und die Dateien zum Repository hinzufügen.
  321. <code>git commit</code> öffnet den Standard Texteditor mit einer ähnlichen Meldung:</p><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> GNU nano 2.7.4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; File: /mnt/c/Users/m0e/Documents/GIT/Test-GIT-TUT/.git/COMMIT_EDITMSG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"># Please enter the commit message for your changes. Lines starting</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"># with '#' will be ignored, and an empty message aborts the commit.</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"># On branch master</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">#</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"># Initial commit</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">#</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"># Changes to be committed:</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"># &nbsp; &nbsp; &nbsp; new file: &nbsp; README.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"># &nbsp; &nbsp; &nbsp; new file: &nbsp; Test.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">#</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 273px;"></div><div class="CodeMirror-gutters" style="display: none; height: 273px;"></div></div></div></pre><p>hier kann man noch weiter Kommentare einfügen, i.d.R. wird man die vorhanden Kommentare lassen, welches die Ausgabe von <code>git status</code> enthält. Hierdurch erkennt man besser was genau mit dem Commit geändert wurde. Gibt man zusätzlich den Schalter -v mit an wird noch ein DateiDiff der Commitmeldung hinzugefügt.</p><p>Bei kleinen Änderungen kann die Commit Nachricht auch direkt im BEfehl mitgegeben werden </p><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">$ git commit -m "Schneller Commit, kleine Bugfixes"</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">[master (root-commit) f99b0dd] Schneller Commit, kleine Bugfixes</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> 2 files changed, 4 insertions(+)</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> create mode 100644 README.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> create mode 100644 Test.md</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 105px;"></div><div class="CodeMirror-gutters" style="display: none; height: 105px;"></div></div></div></pre><p>Die Ausgabe darunter teilt uns nun mit das der Commit erfolgreich dem <code>master Branch</code> hinzugefügt wurde, die SHA-1 Checksumme <em>(f99b0dd)</em>, die Commitmeldung, die geänderten Dateien und eine Angabe über die hinzugefügten oder entfernten Zeilen.</p><p>Für Dateien die bereits mit <code>git add</code> hinzugefügt wurden kann man später das Staging überspringen.</p><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">$ git commit -a -m "Schneller Commit, kleine Bugfixes, OHNE Staging"</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">[master f205c80] Schneller Commit, kleine Bugfixes, OHNE Staging</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> 1 file changed, 3 insertions(+)</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 63px;"></div><div class="CodeMirror-gutters" style="display: none; height: 63px;"></div></div></div></pre><p>Normalerweise wird man im Umgang mit GIT einen Zentralen Server wie Github, Gitlab, Bitbucket oder selbsteghostet benutzen. Um unserem Lokalen Repository diesen Server bekannt zu machen führen wir den folgenden Befehl aus:
  322. <code>git remote add origin https://github.com/darthm0e/Test-GIT-TUT.git</code>
  323. Im Beispiel wird das <strong>Vorher</strong> angelegte Repository <a href='https://github.com/darthm0e/Test-GIT-TUT'>Test-GIT-TUT</a> auf <a href='http://www.github.com'>Github</a> benutzt. </p><p>Wenn wir jetzt <code>git push -u origin master</code> ausführen werden unsere Daten des Commits auf den Remote Server (origin, Name wählbar) in den Master-Branch geladen. Hiermit können auch weiter Server oder Branches hinzugefügt werden.
  324. <code>git push -u developer nightly</code> würde die Daten auf einen mit <code>git remote</code> als Developer in die <em>Nightly-Branch</em> laden.</p><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">$ git push -u origin master</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Username for 'https://github.com': supamoe25@gmail.com</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Password for 'https://supamoe25@gmail.com@github.com':</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Counting objects: 7, done.</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Delta compression using up to 8 threads.</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Compressing objects: 100% (4/4), done.</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Writing objects: 100% (7/7), 612 bytes | 0 bytes/s, done.</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Total 7 (delta 0), reused 0 (delta 0)</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">To https://github.com/darthm0e/Test-GIT-TUT.git</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> * [new branch] &nbsp; &nbsp; master -&gt; master</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Branch master set up to track remote branch master from origin.</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 231px;"></div><div class="CodeMirror-gutters" style="display: none; height: 231px;"></div></div></div></pre><p>Gibt man nun jemandem den Link zum Repository, kann sich dieser den Inhalt anschauen, auf seinen Rechner laden, bearbeiten, änderungen hochladen (schreibrechte vorrausgesetzt) etc.</p><p><code>git clone &lt;link&gt;</code> oder <code>git clone --recursive &lt;link&gt;</code></p><p>lädt das Repository in einen Unterordner(Name des Repo) ins aktuelle Verzeichniss.</p><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">$ git clone https://github.com/darthm0e/Test-GIT-TUT.git</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Cloning into 'Test-GIT-TUT'...</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">remote: Enumerating objects: 7, done.</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">remote: Counting objects: 100% (7/7), done.</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">remote: Compressing objects: 100% (4/4), done.</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">remote: Total 7 (delta 0), reused 7 (delta 0), pack-reused 0</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Unpacking objects: 100% (7/7), done.</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 147px;"></div><div class="CodeMirror-gutters" style="display: none; height: 147px;"></div></div></div></pre><p>Mit <code>git log</code> bzw <code>git log -p</code> kann man sich alle Commits bzw alle Commits mit änderungen anzeigen lassen:</p><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="" style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">$ git log</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">commit f205c80841f3b37957101285fc6af5b1691cc81d</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Author: m0e &lt;supamoe25@gmail.com&gt;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Date: &nbsp; Sat Jan 19 16:01:40 2019 +0100</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; Schneller Commit, kleine Bugfixes, OHNE Staging</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">commit f99b0dd5b53a0f66e893bf6cd269eca779851082</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Author: m0e &lt;supamoe25@gmail.com&gt;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Date: &nbsp; Sat Jan 19 15:55:32 2019 +0100</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; Schneller Commit, kleine Bugfixes</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">(END)</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 294px;"></div><div class="CodeMirror-gutters" style="display: none; height: 294px;"></div></div></div></pre><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="" style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">git log -p</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">commit f205c80841f3b37957101285fc6af5b1691cc81d</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Author: m0e &lt;supamoe25@gmail.com&gt;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Date: &nbsp; Sat Jan 19 16:01:40 2019 +0100</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; Schneller Commit, kleine Bugfixes, OHNE Staging</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">diff --git a/Test.md b/Test.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">index 980a0d5..d6baa93 100644</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">--- a/Test.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">+++ b/Test.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">@@ -1 +1,4 @@</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> Hello World!</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">+</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">+</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">+Was hinzugef&lt;C3&gt;&lt;BC&gt;gt</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">commit f99b0dd5b53a0f66e893bf6cd269eca779851082</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Author: m0e &lt;supamoe25@gmail.com&gt;</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Date: &nbsp; Sat Jan 19 15:55:32 2019 +0100</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; Schneller Commit, kleine Bugfixes</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">diff --git a/README.md b/README.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">new file mode 100644</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">index 0000000..8829e9f</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">--- /dev/null</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">+++ b/README.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">@@ -0,0 +1,3 @@</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">+Hello World !</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">+</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">+Daten fuers GIT Tut</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">diff --git a/Test.md b/Test.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">new file mode 100644</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">index 0000000..980a0d5</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">--- /dev/null</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">+++ b/Test.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">@@ -0,0 +1 @@</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">+Hello World!</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">(END)</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 861px;"></div><div class="CodeMirror-gutters" style="display: none; height: 861px;"></div></div></div></pre><p>Eine Übersicht über die vorhandenen Remote Repositorys gibt <code>git remote -v</code></p><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">$ git remote -v</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">origin https://github.com/darthm0e/Test-GIT-TUT.git (fetch)</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">origin https://github.com/darthm0e/Test-GIT-TUT.git (push)</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 63px;"></div><div class="CodeMirror-gutters" style="display: none; height: 63px;"></div></div></div></pre><p>Um die aktuellsten Änderungen ins lokale Repository zu übertragen führt man <code>git pull</code> aus. GIT versucht die neuen Commits aus dem Remote Repository zu holen und mit den lokalen Dateien zusammenzuführen.</p><p>&nbsp;</p><p>&nbsp;</p><h3><a name='header-n55' class='md-header-anchor '></a>Branching</h3><p><img src='img/branching.png' alt='branching' referrerPolicy='no-referrer' /></p><p>&nbsp;</p><p>git branch &quot;branchname&quot;<span> </span>-&gt;<span> </span>Branch erstellen</p><p>git checkout &quot;branchname&quot;<span> </span>-&gt;<span> </span>Zum Branch wechseln</p><p>git push --set-upstream origin &quot;branchname&quot;<span> </span>-&gt;<span> </span>Branch hochladen</p><p>git checkout master<span> </span>-&gt;<span> </span>Zurück zum master Branch</p><p>git merge &quot;branchname&quot;<span> </span>-&gt;<span> </span>branch einchecken</p><p>git branch -d &quot;brnachname&quot;<span> </span>-&gt;<span> </span>branch löschen</p><p>git push<span> </span>-&gt;<span> </span>hochladen</p><p>&nbsp;</p><h3><a name='header-n66' class='md-header-anchor '></a>Tags</h3><p>In GIT (wie auch in anderen VersionControll-Systemen - VCS) können mit Hilfe von Tags wichtige Punkte in der Commit-Hitory markiert werden. Normalerweise werden hiermit ReleaseVersionen oder andere Meilensteine markiert.
  325. <img src='img/tag.png' alt='tags' referrerPolicy='no-referrer' />
  326. Um sich die in einem Repository vorhandenn Tags anzeigen zu lassen wird <code>git tag</code> benutzt. Hiermit werden die Tags in alphabetischer Reihenfolge aufgelistet</p><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang=""><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 4px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">$&gt; git tag</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">0.1</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">help</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">testing</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 84px;"></div><div class="CodeMirror-gutters" style="display: none; height: 84px;"></div></div></div></pre><p>Um nur bestimmte Tags zu sehen kann man folgenden Befehl verwenden: <code>git tag -l &#39;v1.4.2&#39;</code></p><p>GIT unterscheidet 2 Arten von Tags, einfache (engl. lightweight) und kommentierte (engl. annotated)
  327. Ein normaler Tag ist lediglich ein Zeiger auf einen Commit. Der Tag bleibt mit dem Commit verbunden und wird auch von nachfolgenden Änderungen nicht beeinflusst.
  328. Ein Kommentierter Tag wird als vollwertiges Objekt in GIT gespeichert (ähnlich Commit) und umfasst eine Checksumme, Namen des Verfassers, die eMail Adresse das Datum und sowie eine Tag Nachricht. Desweiteren kann solch ein Tag mit GPG signiert werden.</p><p>&nbsp;</p><p>Um nur bestimmte Tags zu sehen kann man folgenden Befehl verwenden: <code>git tag -l &#39;v1.4.2&#39;</code>
  329. git tag<span> </span>-&gt;<span> </span>Tags anzeigen</p><p>git tag -a v1.2.3 -m &quot;Version 1.2.3&quot;<span> </span>-&gt;<span> </span>Kommentierter Tag erstellen</p><p>git tag -s v1.5 -m &#39;my signed 1.5 tag&#39;<span> </span>-&gt;<span> </span>Tag mit GPG signieren</p><p>git push origin --tags <span> </span>-&gt;<span> </span>Tags in Repo pushen</p><p>&nbsp;</p><h2><a name='header-n77' class='md-header-anchor '></a>Aliase und Autovervollständigung</h2><h3><a name='header-n78' class='md-header-anchor '></a>Autocompletion</h3><p>Um für GIT Befehle eine Autovervollständigung zu erhalten, läd man (hier für BASH) das Script unter: <a href='%20https://github.com/git/git/blob/master/contrib/completion/git-completion.bash'>Git-completion.bash</a>
  330. herunter, und fügt <code>source ~/git-completion.bash</code> zu .bashrc hinzu.</p><h3><a name='header-n80' class='md-header-anchor '></a>Alias</h3><p>-- coming soon --</p><h2><a name='header-n83' class='md-header-anchor '></a>Reset lokal Repository</h2><p>git fetch origin</p><p>git reset –hard origin/master</p><p>&nbsp;</p><hr /><h2><a name='header-n88' class='md-header-anchor '></a>Software (Windows oder MultiPlattform)</h2><p><a href='https://git-scm.com/download/win'>GitBash &amp; GitGUI</a>
  331. <img src='img/gitGUI.png' alt='gitGUI' referrerPolicy='no-referrer' /> <sup>GitGUI</sup> <sup>Hauptfenster</sup></p><p><a href='https://www.sourcetreeapp.com/'>SourceTree</a></p><p><a href='https://desktop.github.com/'>Github Desktop</a>
  332. <img src='img/gitDesktop.png' alt='gitDesktop' referrerPolicy='no-referrer' /> <sup>Github</sup> <sup>Desktop</sup> <sup>Hauptfenster</sup></p><p><a href='https://www.gitkraken.com/'>Git Kraken</a></p><p><a href='https://git-fork.com/'>Fork</a></p><p><a href='https://github.com/FabriceSalvaire/CodeReview/'>CodeReview</a></p><p><a href='https://gitblade.com/'>Git Blade</a></p><hr /><h2><a name='header-n97' class='md-header-anchor '></a>Häufiger Workflow</h2><p>Während der Entwicklungsarbeit wird der Workflow meistens in etwa so aussehen:</p><ul><li>Aktuellen master-Branch vom Server downloaden (vorher mit git status sicherstellen, dass man sich auf dem master-Branch befindet. Wenn nicht: git checkout master):
  333. <code>#&gt; git pull</code></li><li>Einen neuen Branch für das kommende Feature anlegen:
  334. <code>#&gt; git checkout -b meinfeature master</code></li><li>[Änderungen am Code durchführen]</li><li>Geänderte und neue Dateien stagen:
  335. <code>#&gt; git add .</code></li><li>Änderungen committen:
  336. <code>#&gt; git commit -m &quot;Changes xyz&quot;</code></li><li>Jetzt den Branch auf den Server laden, wenn gewünscht:
  337. <code>#&gt; git push -u origin meinfeature</code></li><li>… oder direkt in dem master wechseln:
  338. <code>#&gt; git checkout master</code></li><li>(nochmals aktuellen Code ziehen - zur Sicherheit)
  339. <code>#&gt; git pull</code></li><li>Eigenen Code mit master zusammenführen:
  340. <code>#&gt; git merge meinfeature</code></li><li>Nicht mehr benötigten Branch löschen:
  341. <code>#&gt; git branch -d meinfeature</code></li><li>Aktualisierten master auf den Server pushen:
  342. <code>#&gt; git push</code></li></ul><ul><li>Fertig</li></ul><h2><a name='header-n126' class='md-header-anchor '></a>weitere Befehle</h2><p><code>git stat</code></p><p><code>git diff</code></p><p><code>git fetch</code></p><p><code>git mv</code></p><p><code>git show</code></p><p><code>git remote show origin</code></p><p><code>git remote rm &lt;name&gt;</code></p><p><code>git rebase</code></p><hr /><p><em>~ Made by m0e@2019 --- enigma42Labs ~</em></p></div>
  343. </body>
  344. </html>