123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446 |
- <!doctype html>
- <html>
- <head>
- <meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
- <title>GIT-Tutorial</title><link href='night/mermaid.dark.css' rel='stylesheet' type='text/css' />
- <link href='night/codeblock.dark.css' rel='stylesheet' type='text/css' />
- <link href='night/sourcemode.dark.css' rel='stylesheet' type='text/css' /><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; }
- 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; }
- 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; }
- iframe { margin: auto; }
- a.url { word-break: break-all; }
- a:active, a:hover { outline: 0px; }
- .in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
- #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; }
- #write.first-line-indent p { text-indent: 2em; }
- #write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
- #write.first-line-indent li { margin-left: 2em; }
- .for-image #write { padding-left: 8px; padding-right: 8px; }
- body.typora-export { padding-left: 30px; padding-right: 30px; }
- .typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
- @media screen and (max-width: 500px) {
- body.typora-export { padding-left: 0px; padding-right: 0px; }
- .CodeMirror-sizer { margin-left: 0px !important; }
- .CodeMirror-gutters { display: none !important; }
- }
- #write li > figure:first-child { margin-top: -20px; }
- #write ol, #write ul { position: relative; }
- img { max-width: 100%; vertical-align: middle; }
- 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; }
- input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
- *, ::after, ::before { box-sizing: border-box; }
- #write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
- #write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
- h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 2; }
- p { orphans: 4; }
- h1 { font-size: 2rem; }
- h2 { font-size: 1.8rem; }
- h3 { font-size: 1.6rem; }
- h4 { font-size: 1.4rem; }
- h5 { font-size: 1.2rem; }
- h6 { font-size: 1rem; }
- .md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
- .hidden { display: none; }
- .md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
- a { cursor: pointer; }
- sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
- sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
- #write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
- figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
- figure > table { margin: 0px !important; }
- tr { break-inside: avoid; break-after: auto; }
- thead { display: table-header-group; }
- table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
- table.md-table td { min-width: 32px; }
- .CodeMirror-gutters { border-right: 0px; background-color: inherit; }
- .CodeMirror { text-align: left; }
- .CodeMirror-placeholder { opacity: 0.3; }
- .CodeMirror pre { padding: 0px 4px; }
- .CodeMirror-lines { padding: 0px; }
- div.hr:focus { cursor: none; }
- #write pre { white-space: pre-wrap; }
- #write.fences-no-line-wrapping pre { white-space: pre; }
- #write pre.ty-contain-cm { white-space: normal; }
- .CodeMirror-gutters { margin-right: 4px; }
- .md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
- .md-diagram-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
- #write .md-fences.mock-cm { white-space: pre-wrap; }
- .md-fences.md-fences-with-lineno { padding-left: 0px; }
- #write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
- .md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
- .CodeMirror-line, twitterwidget { break-inside: avoid; }
- .footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
- .footnotes + .footnotes { margin-top: 0px; }
- .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; }
- li div { padding-top: 0px; }
- blockquote { margin: 1rem 0px; }
- li .mathjax-block, li p { margin: 0.5rem 0px; }
- li { margin: 0px; position: relative; }
- blockquote > :last-child { margin-bottom: 0px; }
- blockquote > :first-child, li > :first-child { margin-top: 0px; }
- .footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
- #write .footnote-line { white-space: pre-wrap; }
- @media print {
- body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; }
- #write { margin-top: 0px; padding-top: 0px; border-color: transparent !important; }
- .typora-export * { -webkit-print-color-adjust: exact; }
- html.blink-to-pdf { font-size: 13px; }
- .typora-export #write { padding-left: 32px; padding-right: 32px; padding-bottom: 0px; break-after: avoid; }
- .typora-export #write::after { height: 0px; }
- @page { margin: 20mm 0px; }
- }
- .footnote-line { margin-top: 0.714em; font-size: 0.7em; }
- a img, img a { cursor: pointer; }
- 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; }
- p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
- p > .md-image:only-child { display: inline-block; width: 100%; }
- #write .MathJax_Display { margin: 0.8em 0px 0px; }
- .md-math-block { width: 100%; }
- .md-math-block:not(:empty)::after { display: none; }
- [contenteditable="true"]:active, [contenteditable="true"]:focus { outline: 0px; box-shadow: none; }
- .md-task-list-item { position: relative; list-style-type: none; }
- .task-list-item.md-task-list-item { padding-left: 0px; }
- .md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); }
- .math { font-size: 1rem; }
- .md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
- .md-toc-content { position: relative; margin-left: 0px; }
- .md-toc-content::after, .md-toc::after { display: none; }
- .md-toc-item { display: block; color: rgb(65, 131, 196); }
- .md-toc-item a { text-decoration: none; }
- .md-toc-inner:hover { text-decoration: underline; }
- .md-toc-inner { display: inline-block; cursor: pointer; }
- .md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
- .md-toc-h2 .md-toc-inner { margin-left: 2em; }
- .md-toc-h3 .md-toc-inner { margin-left: 4em; }
- .md-toc-h4 .md-toc-inner { margin-left: 6em; }
- .md-toc-h5 .md-toc-inner { margin-left: 8em; }
- .md-toc-h6 .md-toc-inner { margin-left: 10em; }
- @media screen and (max-width: 48em) {
- .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
- .md-toc-h4 .md-toc-inner { margin-left: 5em; }
- .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
- .md-toc-h6 .md-toc-inner { margin-left: 8em; }
- }
- a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
- .footnote-line a:not(.reversefootnote) { color: inherit; }
- .md-attr { display: none; }
- .md-fn-count::after { content: "."; }
- code, pre, samp, tt { font-family: var(--monospace); }
- 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; }
- .md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: var(--monospace); }
- code { text-align: left; vertical-align: initial; }
- 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; }
- .md-inline-math .MathJax_SVG .noError { display: none !important; }
- .html-for-mac .inline-math-svg .MathJax_SVG { vertical-align: 0.2px; }
- .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; }
- .MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
- .MathJax_SVG .MJX-monospace { font-family: var(--monospace); }
- .MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
- .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; }
- .MathJax_SVG * { transition: none; }
- .MathJax_SVG_Display svg { vertical-align: middle !important; margin-bottom: 0px !important; }
- .os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
- .md-diagram-panel > svg { max-width: 100%; }
- [lang="mermaid"] svg, [lang="flow"] svg { max-width: 100%; }
- [lang="mermaid"] .node text { font-size: 1rem; }
- table tr th { border-bottom: 0px; }
- video { max-width: 100%; display: block; margin: 0px auto; }
- iframe { max-width: 100%; width: 100%; border: none; }
- .highlight td, .highlight tr { border: 0px; }
- .CodeMirror { height: auto; }
- .CodeMirror.cm-s-inner { background: inherit; }
- .CodeMirror-scroll { overflow-y: hidden; overflow-x: auto; z-index: 3; }
- .CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
- .CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; }
- .CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
- .cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
- .cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
- .cm-s-inner .cm-number { color: rgb(17, 102, 68); }
- .cm-s-inner .cm-def { color: rgb(0, 0, 255); }
- .cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
- .cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
- .cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
- .cm-s-inner .cm-string { color: rgb(170, 17, 17); }
- .cm-s-inner .cm-property { color: rgb(0, 0, 0); }
- .cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
- .cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
- .cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
- .cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
- .cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
- .cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
- .cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
- .cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
- .cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
- .cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
- .cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
- .cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
- .cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
- .cm-negative { color: rgb(221, 68, 68); }
- .cm-positive { color: rgb(34, 153, 34); }
- .cm-header, .cm-strong { font-weight: 700; }
- .cm-del { text-decoration: line-through; }
- .cm-em { font-style: italic; }
- .cm-link { text-decoration: underline; }
- .cm-error { color: red; }
- .cm-invalidchar { color: red; }
- .cm-constant { color: rgb(38, 139, 210); }
- .cm-defined { color: rgb(181, 137, 0); }
- div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
- div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
- .cm-s-inner .CodeMirror-activeline-background { background: inherit; }
- .CodeMirror { position: relative; overflow: hidden; }
- .CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; }
- .CodeMirror-sizer { position: relative; }
- .CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; }
- .CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
- .CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: hidden; }
- .CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
- .CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
- .CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 30px; z-index: 3; }
- .CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
- .CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
- .CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
- .CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
- .CodeMirror-lines { cursor: text; }
- .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; }
- .CodeMirror-wrap pre { word-wrap: break-word; white-space: pre-wrap; word-break: normal; }
- .CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
- .CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
- .CodeMirror-linebackground { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; z-index: 0; }
- .CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
- .CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
- .CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
- .CodeMirror-measure pre { position: static; }
- .CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
- .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
- .CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
- .cm-searching { background: rgba(255, 255, 0, 0.4); }
- @media print {
- .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
- }
- .cm-s-inner .cm-variable, .cm-s-inner .cm-operator, .cm-s-inner .cm-property { color: rgb(184, 191, 198); }
- .cm-s-inner .cm-keyword { color: rgb(200, 143, 208); }
- .cm-s-inner .cm-tag { color: rgb(125, 244, 106); }
- .cm-s-inner .cm-attribute { color: rgb(117, 117, 228); }
- .CodeMirror div.CodeMirror-cursor { border-left: 1px solid rgb(184, 191, 198); z-index: 3; }
- .cm-s-inner .cm-string { color: rgb(210, 107, 107); }
- .cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(218, 146, 74); }
- .cm-s-inner .cm-header, .cm-s-inner .cm-def, .cm-s-inner.cm-header, .cm-s-inner.cm-def { color: rgb(141, 141, 240); }
- .cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(87, 172, 87); }
- .cm-s-inner .cm-hr { color: rgb(216, 213, 213); }
- .cm-s-inner .cm-link { color: rgb(211, 211, 239); }
- .cm-s-inner .cm-negative { color: rgb(217, 80, 80); }
- .cm-s-inner .cm-positive { color: rgb(80, 230, 80); }
- .cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
- .cm-s-inner .cm-meta, .cm-s-inner .cm-qualifier { color: rgb(183, 179, 179); }
- .cm-s-inner .cm-builtin { color: rgb(243, 179, 248); }
- .cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
- .cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(132, 182, 203); }
- .cm-s-inner .cm-number { color: rgb(100, 171, 143); }
- .cm-s-inner .cm-variable { color: rgb(184, 191, 198); }
- .cm-s-inner .cm-variable-2 { color: rgb(159, 186, 213); }
- .cm-s-inner .cm-variable-3 { color: rgb(28, 198, 133); }
- .CodeMirror-selectedtext, .CodeMirror-selected { background: rgb(74, 137, 220); text-shadow: none; color: rgb(255, 255, 255) !important; }
- .CodeMirror-gutters { border-right: none; }
- :root { --bg-color: #363B40; --side-bar-bg-color: #2E3033; --text-color: #b8bfc6; --select-text-bg-color:#4a89dc; --control-text-color: #b7b7b7; --control-text-hover-color: #eee; --window-border: 1px solid #555; --active-file-bg-color: rgb(34, 34, 34); --active-file-border-color: #8d8df0; --active-file-text-color: white; --item-hover-bg-color: #70717d; --item-hover-text-color: white; --primary-color: #6dc1e7; --rawblock-edit-panel-bd: #4B535A; }
- html { font-size: 16px; }
- html, body { text-size-adjust: 100%; background: var(--bg-color); fill: currentcolor; }
- #write { max-width: 914px; }
- html, body, button, input, select, textarea, div.code-tooltip-content { color: rgb(184, 191, 198); border-color: transparent; }
- div.code-tooltip, .md-hover-tip .md-arrow::after { background: rgb(75, 83, 90); }
- .popover.bottom > .arrow::after { border-bottom-color: rgb(75, 83, 90); }
- html, body, button, input, select, textarea { font-style: normal; line-height: 1.625rem; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
- hr { height: 2px; border: 0px; margin: 24px 0px !important; }
- h1, h2, h3, h4, h5, h6 { font-family: "Lucida Grande", Corbel, sans-serif; font-weight: normal; clear: both; word-wrap: break-word; margin: 0px; padding: 0px; color: rgb(222, 222, 222); }
- h1 { font-size: 2.5rem; line-height: 2.75rem; margin-bottom: 1.5rem; letter-spacing: -1.5px; }
- h2 { font-size: 1.63rem; line-height: 1.875rem; margin-bottom: 1.5rem; letter-spacing: -1px; font-weight: bold; }
- h3 { font-size: 1.17rem; line-height: 1.5rem; margin-bottom: 1.5rem; letter-spacing: -1px; font-weight: bold; }
- h4 { font-size: 1.12rem; line-height: 1.375rem; margin-bottom: 1.5rem; color: white; }
- h5 { font-size: 0.97rem; line-height: 1.25rem; margin-bottom: 1.5rem; font-weight: bold; }
- h6 { font-size: 0.93rem; line-height: 1rem; margin-bottom: 0.75rem; color: white; }
- @media (min-width: 980px) {
- h3.md-focus::before, h4.md-focus::before, h5.md-focus::before, h6.md-focus::before { color: rgb(221, 221, 221); border: 1px solid rgb(221, 221, 221); border-radius: 3px; position: absolute; left: -1.64286rem; top: 0.357143rem; float: left; font-size: 9px; padding-left: 2px; padding-right: 2px; vertical-align: bottom; font-weight: normal; line-height: normal; }
- h3.md-focus::before { content: "h3"; }
- h4.md-focus::before { content: "h4"; }
- h5.md-focus::before { content: "h5"; top: 0px; }
- h6.md-focus::before { content: "h6"; top: 0px; }
- }
- a { text-decoration: none; outline: 0px; }
- a:hover { outline: 0px; }
- a:focus { outline: dotted thin; }
- sup.md-footnote { background-color: rgb(85, 85, 85); color: rgb(221, 221, 221); }
- p { word-wrap: break-word; }
- p, ul, dd, ol, hr, address, pre, table, iframe, .wp-caption, .wp-audio-shortcode, .wp-video-shortcode { margin-top: 0px; margin-bottom: 1.5rem; }
- li > blockquote { margin-bottom: 0px; }
- audio:not([controls]) { display: none; }
- [hidden] { display: none; }
- .in-text-selection, ::selection { background: rgb(74, 137, 220); color: rgb(255, 255, 255); text-shadow: none; }
- ul, ol { padding: 0px 0px 0px 1.875rem; }
- ul { list-style: square; }
- ol { list-style: decimal; }
- ul ul, ol ol, ul ol, ol ul { margin: 0px; }
- b, th, dt, strong { font-weight: bold; }
- i, em, dfn, cite { font-style: italic; }
- blockquote { margin: 35px 0px 1.875rem 1.875rem; border-left: 2px solid rgb(71, 77, 84); padding-left: 30px; }
- pre, code, kbd, tt, var { background: rgba(0, 0, 0, 0.05); font-size: 0.875rem; font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; }
- kbd { padding: 2px 4px; font-size: 90%; color: rgb(255, 255, 255); background-color: rgb(51, 51, 51); border-radius: 3px; box-shadow: rgba(0, 0, 0, 0.25) 0px -1px 0px inset; }
- pre.md-fences { padding: 10px 30px; margin-bottom: 20px; border: 1px solid; }
- .md-fences .code-tooltip { bottom: -3.2em; }
- .enable-diagrams pre.md-fences[lang="sequence"] .code-tooltip, .enable-diagrams pre.md-fences[lang="flow"] .code-tooltip, .enable-diagrams pre.md-fences[lang="mermaid"] .code-tooltip { bottom: -2.2em; right: 4px; }
- code, kbd, tt, var { padding: 2px 5px; }
- table { max-width: 100%; width: 100%; border-collapse: collapse; border-spacing: 0px; }
- th, td { padding: 5px 10px; vertical-align: top; }
- a { transition: all 0.2s ease-in-out; }
- hr { background: rgb(71, 77, 84); }
- h1 { margin-top: 2em; }
- a { color: rgb(224, 224, 224); text-decoration: underline; }
- a:hover { color: rgb(255, 255, 255); }
- .md-inline-math script { color: rgb(129, 177, 219); }
- b, th, dt, strong { color: rgb(222, 222, 222); }
- mark { background: rgb(211, 212, 14); }
- blockquote { color: rgb(157, 162, 166); }
- table a { color: rgb(222, 222, 222); }
- th, td { border: 1px solid rgb(71, 77, 84); }
- .task-list { padding-left: 0px; }
- .md-task-list-item { padding-left: 1.25rem; }
- .md-task-list-item > input { top: auto; }
- .md-task-list-item > input::before { content: ""; display: inline-block; width: 0.875rem; height: 0.875rem; vertical-align: middle; text-align: center; border: 1px solid rgb(184, 191, 198); background-color: rgb(54, 59, 64); margin-top: -0.4rem; }
- .md-task-list-item > input:checked::before, .md-task-list-item > input[checked]::before { content: "√"; font-size: 0.625rem; line-height: 0.625rem; color: rgb(222, 222, 222); }
- .CodeMirror-gutters { background: transparent; border-right: 1px solid transparent; }
- .auto-suggest-container { border: 0px; background-color: rgb(82, 92, 101); }
- #typora-quick-open { background-color: rgb(82, 92, 101); }
- #typora-quick-open input { background-color: rgb(82, 92, 101); border-width: 0px 0px 1px; border-top-style: initial; border-right-style: initial; border-left-style: initial; border-top-color: initial; border-right-color: initial; border-left-color: initial; border-image: initial; border-bottom-style: solid; border-bottom-color: grey; }
- .typora-quick-open-item { background-color: inherit; color: inherit; }
- .typora-quick-open-item.active, .typora-quick-open-item:hover { background-color: rgb(77, 139, 219); color: white; }
- .typora-quick-open-item:hover { background-color: rgba(77, 139, 219, 0.8); }
- .typora-search-spinner > div { background-color: rgb(255, 255, 255); }
- #write pre.md-meta-block { border-bottom: 1px dashed rgb(204, 204, 204); background: transparent; padding-bottom: 0.6em; line-height: 1.6em; }
- .btn, .btn .btn-default { background: transparent; color: rgb(184, 191, 198); }
- .ty-table-edit { border-top: 1px solid gray; background-color: rgb(54, 59, 64); }
- .popover-title { background: transparent; }
- .md-image > .md-meta { color: rgb(187, 187, 187); background: transparent; }
- .md-expand.md-image > .md-meta { color: rgb(221, 221, 221); }
- #write > h3::before, #write > h4::before, #write > h5::before, #write > h6::before { border: none; border-radius: 0px; color: rgb(136, 136, 136); text-decoration: underline; left: -1.4rem; top: 0.2rem; }
- #write > h3.md-focus::before { top: 2px; }
- #write > h4.md-focus::before { top: 2px; }
- .md-toc-item { color: rgb(168, 194, 220); }
- #write div.md-toc-tooltip { background-color: rgb(54, 59, 64); }
- .dropdown-menu .btn:hover, .dropdown-menu .btn:focus, .md-toc .btn:hover, .md-toc .btn:focus { color: white; background: black; }
- #toc-dropmenu { background: rgba(50, 54, 59, 0.93); border: 1px solid rgba(253, 253, 253, 0.15); }
- #toc-dropmenu .divider { background-color: rgb(155, 155, 155); }
- .outline-expander::before { top: 2px; }
- #typora-sidebar { box-shadow: none; border-right: none; }
- .sidebar-tabs { border-bottom: 0px; }
- #typora-sidebar:hover .outline-title-wrapper { border-left: 1px dashed; }
- .outline-title-wrapper .btn { color: inherit; }
- .outline-item:hover { border-color: rgb(54, 59, 64); background-color: rgb(54, 59, 64); color: white; }
- h1.md-focus .md-attr, h2.md-focus .md-attr, h3.md-focus .md-attr, h4.md-focus .md-attr, h5.md-focus .md-attr, h6.md-focus .md-attr, .md-header-span .md-attr { color: rgb(140, 142, 146); display: inline; }
- .md-comment { color: rgb(90, 149, 227); opacity: 1; }
- .md-inline-math g, .md-inline-math svg { stroke: rgb(184, 191, 198) !important; fill: rgb(184, 191, 198) !important; }
- [md-inline="inline_math"] { color: rgb(156, 178, 233); }
- #math-inline-preview .md-arrow::after { background: black; }
- .modal-content { background: var(--bg-color); border: 0px; }
- .modal-title { font-size: 1.5em; }
- .modal-content input { background-color: rgba(26, 21, 21, 0.51); color: white; }
- .modal-content .input-group-addon { background-color: rgba(0, 0, 0, 0.17); color: white; }
- .modal-backdrop { background-color: rgba(174, 174, 174, 0.7); }
- .modal-content .btn-primary { border-color: var(--primary-color); }
- .md-table-resize-popover { background-color: rgb(75, 83, 90); }
- .form-inline .input-group .input-group-addon { color: white; }
- #md-searchpanel { border-bottom: 1px dashed grey; }
- .context-menu, #spell-check-panel, #footer-word-count-info { background-color: rgb(66, 70, 74); }
- .context-menu.dropdown-menu .divider, .dropdown-menu .divider { background-color: rgb(119, 119, 119); }
- footer { color: inherit; }
- @media (max-width: 1000px) {
- footer { border-top: none; }
- footer:hover { color: inherit; }
- }
- #file-info-file-path .file-info-field-value:hover { background-color: rgb(85, 85, 85); color: rgb(222, 222, 222); }
- .megamenu-content, .megamenu-opened header { background: var(--bg-color); }
- .megamenu-menu-panel h2, .megamenu-menu-panel h1, .long-btn { color: inherit; }
- .megamenu-menu-panel input[type="text"] { background: inherit; border-width: 0px 0px 1px; border-top-style: initial; border-right-style: initial; border-left-style: initial; border-color: initial; border-image: initial; border-bottom-style: solid; }
- #recent-file-panel-action-btn { background: inherit; border: 1px solid grey; }
- .megamenu-menu-panel .dropdown-menu > li > a { color: inherit; background-color: rgb(47, 53, 58); text-decoration: none; }
- .megamenu-menu-panel table td:nth-child(1) { color: inherit; font-weight: bold; }
- .megamenu-menu-panel tbody tr:hover td:nth-child(1) { color: white; }
- .modal-footer .btn-default, .modal-footer .btn-primary, .modal-footer .btn-default:not(:hover) { border: 1px solid transparent; }
- .btn-default:hover, .btn-default:focus, .btn-default.focus, .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { color: white; border: 1px solid rgb(221, 221, 221); background-color: inherit; }
- .modal-header { border-bottom: 0px; }
- .modal-footer { border-top: 0px; }
- #recent-file-panel tbody tr:nth-child(2n-1) { background-color: transparent !important; }
- .megamenu-menu-panel tbody tr:hover td:nth-child(2) { color: inherit; }
- .megamenu-menu-panel .btn { border: 1px solid rgb(238, 238, 238); background: transparent; }
- .mouse-hover .toolbar-icon.btn:hover, #w-full.mouse-hover, #w-pin.mouse-hover { background-color: inherit; }
- .typora-node::-webkit-scrollbar { width: 5px; }
- .typora-node::-webkit-scrollbar-thumb:vertical { background: rgba(250, 250, 250, 0.3); }
- .typora-node::-webkit-scrollbar-thumb:vertical:active { background: rgba(250, 250, 250, 0.5); }
- #w-unpin { background-color: rgb(65, 130, 196); }
- #top-titlebar, #top-titlebar * { color: var(--item-hover-text-color); }
- .typora-sourceview-on #toggle-sourceview-btn, #footer-word-count:hover, .ty-show-word-count #footer-word-count { background: rgb(51, 51, 51); }
- #toggle-sourceview-btn:hover { color: rgb(238, 238, 238); background: rgb(51, 51, 51); }
- .on-focus-mode .md-end-block:not(.md-focus):not(.md-focus-container) * { color: rgb(104, 104, 104) !important; }
- .on-focus-mode .md-end-block:not(.md-focus) img, .on-focus-mode .md-task-list-item:not(.md-focus-container) > input { }
- .on-focus-mode li[cid]:not(.md-focus-container) { color: rgb(104, 104, 104); }
- .on-focus-mode .md-fences.md-focus .CodeMirror-code > :not(.CodeMirror-activeline) *, .on-focus-mode .CodeMirror.cm-s-inner:not(.CodeMirror-focused) * { color: rgb(104, 104, 104) !important; }
- .on-focus-mode .md-focus, .on-focus-mode .md-focus-container { color: rgb(255, 255, 255); }
- .on-focus-mode #typora-source .CodeMirror-code > :not(.CodeMirror-activeline) * { color: rgb(104, 104, 104) !important; }
- #write .md-focus .md-diagram-panel { border: 1px solid rgb(221, 221, 221); margin-left: -1px; width: calc(100% + 2px); }
- #write .md-focus.md-fences-with-lineno .md-diagram-panel { margin-left: auto; }
- .md-diagram-panel-error { color: rgb(241, 144, 142); }
- .active-tab-files #info-panel-tab-file, .active-tab-files #info-panel-tab-file:hover, .active-tab-outline #info-panel-tab-outline, .active-tab-outline #info-panel-tab-outline:hover { color: rgb(238, 238, 238); }
- .sidebar-footer-item:hover, .footer-item:hover { background: inherit; color: white; }
- .ty-side-sort-btn.active, .ty-side-sort-btn:hover, .selected-folder-menu-item a::after { color: white; }
- #sidebar-files-menu { border: 1px solid; box-shadow: rgba(0, 0, 0, 0.79) 4px 4px 20px; background-color: var(--bg-color); }
- .file-list-item { border-bottom: none; }
- .file-list-item-summary { opacity: 1; }
- .file-list-item.active:first-child { border-top: none; }
- .file-node-background { height: 32px; }
- .file-library-node.active > .file-node-content, .file-list-item.active { color: var(--active-file-text-color); }
- .file-library-node.active > .file-node-background { background-color: var(--active-file-bg-color); }
- .file-list-item.active { background-color: var(--active-file-bg-color); }
- #ty-tooltip { background-color: black; color: rgb(238, 238, 238); }
- .md-task-list-item > input { margin-left: -1.3em; margin-top: calc(1rem - 10px); -webkit-appearance: none; }
- .md-mathjax-midline { background-color: rgb(87, 97, 107); border-bottom: none; }
- .typora-export li, .typora-export p, .typora-export, .footnote-line {white-space: normal;}
- </style>
- </head>
- <body class='typora-export os-windows' >
- <div id='write' class = 'is-node'><h1><a name='header-n0' class='md-header-anchor '></a>GIT Tutorial</h1><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">GIT Tutorial</a></span><span class="md-toc-item md-toc-h2" data-ref="n4"><a class="md-toc-inner" href="#header-n4">Hilfreiche Links vorab:</a></span><span class="md-toc-item md-toc-h2" data-ref="n14"><a class="md-toc-inner" href="#header-n14">Grundlegende Befehle:</a></span><span class="md-toc-item md-toc-h2" data-ref="n24"><a class="md-toc-inner" href="#header-n24">Grundlagen</a></span><span class="md-toc-item md-toc-h3" data-ref="n380"><a class="md-toc-inner" href="#header-n380">Branching</a></span><span class="md-toc-item md-toc-h3" data-ref="n64"><a class="md-toc-inner" href="#header-n64">Tags</a></span><span class="md-toc-item md-toc-h2" data-ref="n75"><a class="md-toc-inner" href="#header-n75">Aliase und Autovervollständigung</a></span><span class="md-toc-item md-toc-h3" data-ref="n76"><a class="md-toc-inner" href="#header-n76">Autocompletion</a></span><span class="md-toc-item md-toc-h3" data-ref="n78"><a class="md-toc-inner" href="#header-n78">Alias</a></span><span class="md-toc-item md-toc-h2" data-ref="n81"><a class="md-toc-inner" href="#header-n81">Reset lokal Repository</a></span><span class="md-toc-item md-toc-h2" data-ref="n86"><a class="md-toc-inner" href="#header-n86">Software (Windows oder MultiPlattform)</a></span><span class="md-toc-item md-toc-h2" data-ref="n95"><a class="md-toc-inner" href="#header-n95">Häufiger Workflow</a></span><span class="md-toc-item md-toc-h2" data-ref="n124"><a class="md-toc-inner" href="#header-n124">weitere Befehle</a></span></p></div><h2><a name='header-n4' 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-n14' class='md-header-anchor '></a>Grundlegende Befehle:</h2><p>git init</p><p>git add . || git add <filename></p><p>git commit -m "grund" || git commit -a -m "grund"</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-n24' 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>"Dateisystems"</em>
- 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 > 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).
- 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 "Wildcards" um etwa alle Dateien eines Typs auzunehmen -> <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: 150px;"></div><div class="CodeMirror-gutters" style="display: none; height: 150px;"></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.
- 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 <file>..." 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;"> new file: README.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> new file: 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: 325px;"></div><div class="CodeMirror-gutters" style="display: none; height: 325px;"></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.
- <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 File: /mnt/c/Users/m0e/Documents/GIT/Test-GIT-TUT/.git/COMMIT_EDITMSG </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;"># new file: README.md</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"># new file: 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: 325px;"></div><div class="CodeMirror-gutters" style="display: none; height: 325px;"></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: 125px;"></div><div class="CodeMirror-gutters" style="display: none; height: 125px;"></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: 75px;"></div><div class="CodeMirror-gutters" style="display: none; height: 75px;"></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:
- <code>git remote add origin https://github.com/darthm0e/Test-GIT-TUT.git</code>
- 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.
- <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] master -> 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: 275px;"></div><div class="CodeMirror-gutters" style="display: none; height: 275px;"></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 <link></code> oder <code>git clone --recursive <link></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: 175px;"></div><div class="CodeMirror-gutters" style="display: none; height: 175px;"></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 <supamoe25@gmail.com></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Date: 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;"> 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 <supamoe25@gmail.com></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Date: 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;"> 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: 350px;"></div><div class="CodeMirror-gutters" style="display: none; height: 350px;"></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 <supamoe25@gmail.com></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Date: 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;"> 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<C3><BC>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 <supamoe25@gmail.com></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">Date: 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;"> 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: 1025px;"></div><div class="CodeMirror-gutters" style="display: none; height: 1025px;"></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: 75px;"></div><div class="CodeMirror-gutters" style="display: none; height: 75px;"></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> </p><p> </p><h3><a name='header-n380' class='md-header-anchor '></a>Branching</h3><p><img src='img/branching.png' alt='branching' referrerPolicy='no-referrer' /></p><p> </p><p>git branch "branchname"<span> </span>-><span> </span>Branch erstellen</p><p>git checkout "branchname"<span> </span>-><span> </span>Zum Branch wechseln</p><p>git push --set-upstream origin "branchname"<span> </span>-><span> </span>Branch hochladen</p><p>git checkout master<span> </span>-><span> </span>Zurück zum master Branch</p><p>git merge "branchname"<span> </span>-><span> </span>branch einchecken</p><p>git branch -d "brnachname"<span> </span>-><span> </span>branch löschen</p><p>git push<span> </span>-><span> </span>hochladen</p><p> </p><h3><a name='header-n64' 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.
- <img src='img/tag.png' alt='tags' referrerPolicy='no-referrer' />
- 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;">$> 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: 100px;"></div><div class="CodeMirror-gutters" style="display: none; height: 100px;"></div></div></div></pre><p>Um nur bestimmte Tags zu sehen kann man folgenden Befehl verwenden: <code>git tag -l 'v1.4.2'</code></p><p>GIT unterscheidet 2 Arten von Tags, einfache (engl. lightweight) und kommentierte (engl. annotated)
- 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.
- 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> </p><p>Um nur bestimmte Tags zu sehen kann man folgenden Befehl verwenden: <code>git tag -l 'v1.4.2'</code>
- git tag<span> </span>-><span> </span>Tags anzeigen</p><p>git tag -a v1.2.3 -m "Version 1.2.3"<span> </span>-><span> </span>Kommentierter Tag erstellen</p><p>git tag -s v1.5 -m 'my signed 1.5 tag'<span> </span>-><span> </span>Tag mit GPG signieren</p><p>git push origin --tags <span> </span>-><span> </span>Tags in Repo pushen</p><p> </p><h2><a name='header-n75' class='md-header-anchor '></a>Aliase und Autovervollständigung</h2><h3><a name='header-n76' 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>
- herunter, und fügt <code>source ~/git-completion.bash</code> zu .bashrc hinzu.</p><h3><a name='header-n78' class='md-header-anchor '></a>Alias</h3><p>git config --global alias.upPush ´git add . ; git commit -a -m; git push -u origin´</p><h2><a name='header-n81' class='md-header-anchor '></a>Reset lokal Repository</h2><p>git fetch origin</p><p>git reset –hard origin/master</p><p> </p><hr /><h2><a name='header-n86' class='md-header-anchor '></a>Software (Windows oder MultiPlattform)</h2><p><a href='https://git-scm.com/download/win'>GitBash & GitGUI</a>
- <img src='img/gitGUI.png' alt='gitGUI' referrerPolicy='no-referrer' /> ^GitGUI^ ^Hauptfenster^</p><p><a href='https://www.sourcetreeapp.com/'>SourceTree</a></p><p><a href='https://desktop.github.com/'>Github Desktop</a>
- <img src='img/gitDesktop.png' alt='gitDesktop' referrerPolicy='no-referrer' /> ^Github^ ^Desktop^ ^Hauptfenster^</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-n95' 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):
- <code>#> git pull</code></li><li>Einen neuen Branch für das kommende Feature anlegen:
- <code>#> git checkout -b meinfeature master</code></li><li>[Änderungen am Code durchführen]</li><li>Geänderte und neue Dateien stagen:
- <code>#> git add .</code></li><li>Änderungen committen:
- <code>#> git commit -m "Changes xyz"</code></li><li>Jetzt den Branch auf den Server laden, wenn gewünscht:
- <code>#> git push -u origin meinfeature</code></li><li>… oder direkt in dem master wechseln:
- <code>#> git checkout master</code></li><li>(nochmals aktuellen Code ziehen - zur Sicherheit)
- <code>#> git pull</code></li><li>Eigenen Code mit master zusammenführen:
- <code>#> git merge meinfeature</code></li><li>Nicht mehr benötigten Branch löschen:
- <code>#> git branch -d meinfeature</code></li><li>Aktualisierten master auf den Server pushen:
- <code>#> git push</code></li></ul><ul><li>Fertig</li></ul><h2><a name='header-n124' 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 <name></code></p><p><code>git rebase</code></p><hr /><p><em>~ Made by m0e@2019 --- enigma42Labs ~</em></p></div>
- </body>
- </html>
|