Changes for page Git
Last modified by Richard Kreissig on 2025/01/30 12:03
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -23,6 +23,8 @@ 23 23 $ git init 24 24 Initialized empty Git repository in ~/turing/.git/ 25 25 {{/noformat}} 26 + 27 +The {{code language="none"}}.git{{/code}} subdirectory contains all history and metadata of the repository. You should not modify it. 26 26 ))) 27 27 1. ((( 28 28 Add and commit some content: copy [[attach:notes.txt]]{{code language="none"}}{{/code}} to your {{code language="none"}}turing{{/code}} directory. ... ... @@ -34,6 +34,8 @@ 34 34 1 files changed, 5 insertions(+), 0 deletions(-) 35 35 create mode 100644 notes.txt 36 36 {{/noformat}} 39 + 40 +The file is now stored in the local history of your repository. 37 37 ))) 38 38 1. Edit {{code language="none"}}notes.txt{{/code}}:\\ 39 39 11. Replace "fixed" with "infinite" in line 1. ... ... @@ -116,4 +116,51 @@ 116 116 + * The head is controlled by a finite state machine 117 117 {{/noformat}} 118 118 119 -Note that each commit is identified by a looong hash value, but it is possible to use only a prefix when referencing them (if the prefix is not ambiguous): the example above uses {{code language="none"}}52e2d49{{/code}} to identify the second commit. Also try the command {{code language="none"}}gitk{{/code}} to get an overview of your commits (a better alternative available for MacOS is [[GitX>>url:http://gitx.frim.nl/||shape="rect"]]). The commit hashes in your repository will be different from those seen in this tutorial, because the name of the author and the exact time of committing is also considered in the hash calculation. 123 +Note that each commit is identified by a looong hash value, but it is possible to use only a prefix when referencing them (if the prefix is not ambiguous): the example above uses {{code language="none"}}52e2d49{{/code}} to identify the second commit. The commit hashes in your repository will be different from those seen in this tutorial, because the name of the author and the exact time of committing is also considered in the hash calculation. Also try the command {{code language="none"}}gitk{{/code}} to get an overview of your commits (a better alternative available for MacOS is [[GitX>>url:http://gitx.frim.nl/||shape="rect"]]). 124 + 125 += Branching and Merging = 126 + 127 +In the previous section you have created two commits on the default branch, which is named {{code language="none"}}master{{/code}}. Now you will create a new branch and commit there, thus adding complexity to the commit graph. 128 + 129 +1. ((( 130 +Create a branch with name //sketches//: 131 + 132 +{{noformat}} 133 +$ git branch sketches 134 +{{/noformat}} 135 +))) 136 +1. ((( 137 +View the list of branches: 138 + 139 +{{noformat}} 140 +$ git branch 141 +* master 142 + sketches 143 +{{/noformat}} 144 + 145 +The star reveals that you are still on the old {{code language="none"}}master{{/code}} branch. 146 +))) 147 +1. ((( 148 +Switch to the new branch: 149 + 150 +{{noformat}} 151 +$ git checkout sketches 152 +Switched to branch 'sketches' 153 +$ git branch 154 + master 155 +* sketches 156 +{{/noformat}} 157 + 158 +It is also possible to create a branch and switch immediately to it using the option {{code language="none"}}-b{{/code}} of {{code language="none"}}git checkout{{/code}}. 159 +))) 160 +1. ((( 161 +Add the new file [[attach:examples.txt]]: 162 + 163 +{{noformat}} 164 +$ git add examples.txt 165 +$ git commit -m "wrote first examples" 166 +[sketches cd63135] wrote first examples 167 + 1 files changed, 20 insertions(+), 0 deletions(-) 168 + create mode 100644 examples.txt 169 +{{/noformat}} 170 +)))
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -298212 61 +2982132 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/298212 6/Git1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/2982132/Git