...
- Read the Git for Computer Scientists introduction (skip this if you are already familiar with Git).
- For Linux, Git is available in its own package. Windows users can install msysGit. For MacOS, Git is available as part of Xcode; if you cannot install that, use Git for OSX.
Create a local repository for the "Turing Project":
No Format $ mkdir turing $ cd turing $ git init Initialized empty Git repository in ~/turing/.git/
Panel $ mkdir turing
$ cd turing
$ git init
Initialized empty Git repository in ~/turing/.git/
Code Block language bash $ mkdir turing $ cd turing $ git init Initialized empty Git repository in ~/turing/.git/
Add some content: copy
notes.txt
to yourturing
directory.No Format $ git add notes.txt $ git commit -m "wrote some first notes" [master (root-commit) 2e73b34] wrote some first notes 1 files changed, 5 insertions(+), 0 deletions(-) create mode 100644 notes.txt
- Edit
notes.txt
:- Replace "fixed" with "infinite" in line 1.
- Replace "... (TODO)" with "a finite state machine" in line 4.
Commit the modified content to your local repository:
No Format $ git add notes.txt $ git commit -m "modified tape length, found a controller for tape head" [master 3f28a0e] modified tape length, found a controller for tape head 1 files changed, 2 insertions(+), 2 deletions(-)
After the preceding steps you have two commits in your local repository, each with one file in the index. You have different options commands for viewing these commits:
...
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 3f28a0e
to identify the second commit. Also try the command gitk
to get an overview of your commits (a better alternative available for MacOS is GitX).