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
-
... ... @@ -15,13 +15,9 @@ 15 15 $ git init 16 16 Initialized empty Git repository in ~/turing/.git/ 17 17 {{/noformat}} 18 - 19 -{{panel}} 20 -**$ mkdir turing $ cd turing $ git init**{{code language="none"}} Initialized empty Git repository in ~/turing/.git/{{/code}} 21 -{{/panel}} 22 22 ))) 23 23 1. ((( 24 -Add some content: copy [[attach:notes.txt]]{{code language="none"}}{{/code}} to your {{code language="none"}}turing{{/code}} directory. 20 +Add and commit some content: copy [[attach:notes.txt]]{{code language="none"}}{{/code}} to your {{code language="none"}}turing{{/code}} directory. 25 25 26 26 {{noformat}} 27 27 $ git add notes.txt ... ... @@ -35,23 +35,51 @@ 35 35 11. Replace "fixed" with "infinite" in line 1. 36 36 11. Replace "... (TODO)" with "a finite state machine" in line 4. 37 37 1. ((( 38 - Committhemodified contentto yourlocalrepository:34 +View the status of your current working copy: 39 39 40 40 {{noformat}} 37 +$ git status 38 +# On branch master 39 +# Changed but not updated: 40 +# (use "git add <file>..." to update what will be committed) 41 +# (use "git checkout -- <file>..." to discard changes in working directory) 42 +# 43 +# modified: notes.txt 44 +# 45 +no changes added to commit (use "git add" and/or "git commit -a") 46 +{{/noformat}} 47 +))) 48 +1. ((( 49 +Mark the modified file to include it in the next commit, then view the status again and compare with the previous output: 50 + 51 +{{noformat}} 41 41 $ git add notes.txt 53 +$ git status 54 +# On branch master 55 +# Changes to be committed: 56 +# (use "git reset HEAD <file>..." to unstage) 57 +# 58 +# modified: notes.txt 59 +# 60 +{{/noformat}} 61 +))) 62 +1. ((( 63 +Commit the modified content to your local repository: 64 + 65 +{{noformat}} 42 42 $ git commit -m "modified tape length, found a controller for tape head" 43 -[master 3f28a0e] modified tape length, found a controller for tape head67 +[master 52e2d49] modified tape length, found a controller for tape head 44 44 1 files changed, 2 insertions(+), 2 deletions(-) 45 45 {{/noformat}} 46 46 ))) 47 47 48 -After the preceding steps you have two commits in your local repository, each with one file in the index. You have different o ptions for viewing these commits:72 +After the preceding steps you have two commits in your local repository, each with one file in the index. You have different commands for viewing these commits: 49 49 50 50 {{noformat}} 51 51 $ git log 52 -commit 3f28a0e473bf3da4aff34a09fed838fe033f3bb576 +commit 52e2d4946791c2725015853e5e261ce143c6fe8a 53 53 Author: Miro Spoenemann <msp@informatik.uni-kiel.de> 54 -Date: Mon Oct 15 1 4:30:24 2012 +020078 +Date: Mon Oct 15 15:00:14 2012 +0200 55 55 56 56 modified tape length, found a controller for tape head 57 57 ... ... @@ -61,10 +61,10 @@ 61 61 62 62 wrote some first notes 63 63 64 -$ git show 3f28a0e65 -commit 3f28a0e473bf3da4aff34a09fed838fe033f3bb588 +$ $ git show 52e2d49 89 +commit 52e2d4946791c2725015853e5e261ce143c6fe8a 66 66 Author: Miro Spoenemann <msp@informatik.uni-kiel.de> 67 -Date: Mon Oct 15 1 4:30:24 2012 +020091 +Date: Mon Oct 15 15:00:14 2012 +0200 68 68 69 69 modified tape length, found a controller for tape head 70 70 ... ... @@ -81,4 +81,4 @@ 81 81 + * The head is controlled by a finite state machine 82 82 {{/noformat}} 83 83 84 -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"}} 3f28a0e{{/code}} to identify the second commit.108 +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"]]).
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -29821 161 +2982123 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/29821 16/Git1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/WS12EclPract/pages/2982123/Git