Information Technology Reference
In-Depth Information
You want to start a new project that will consist of text files storing songs for children.
Similar to Recipe 3-1 you plan to save every new file in a new commit. To avoid typ-
ing both $ git add and $ git commit commands, you prefer to use the $ git
snapshot alias, defined in Recipe 3-2.
Solution
Initialize a new repository:
$ cd git-recipes
$ mkdir 03-03
$ cd 03-03
$ git init
Create the first revision containing the lyrics of “Sing a song of sixpence” song.
1. Create the file sing-a-song-of-sixpence.txt
$ vi sing-a-song-of-sixpence.txt
2. Type the contents of the file:
Sing a song of sixpence,
A pocket full of rye.
Four and twenty blackbirds,
Baked in a pie.
...
3. Save the file and close the editor.
4. Check the status of the repository with $ git status -s
The repository is dirty.
5. Save the current state of the working directory as a new revision:
$ git snapshot Sing a song of sixpence
6. Check the status of the repository with $ git status -s
Search WWH ::




Custom Search