Information Technology Reference
In-Depth Information
Problem
You have just committed a set of changes into the repository and a minute later you
realized that there are some additional modifications that should have been incorpor-
ated into the previous revision. You do not want to create yet another commit; you
would prefer to modify an existing revision by adding some extra changes.
Solution
Create a new repository:
$ cd git-recipes
$ git init 08-01
$ cd 08-01
and then follow these steps:
1. Create the file lorem.txt with $ echo lorem > lorem.txt
2. Stage the file with $ git add lorem.txt
3. Commit the file with $ git commit -m “lorem”
The repository contains one revision labeled lorem . Listing 8-1 presents the output
of the $ git log --pretty=fuller command.
Listing 8-1. The original revision that we wish to modify
commit 5a786865f21b5c1725e56c2bf60f6516ce736b9b
Author: Włodzimierz Gajda <gajdaw@gajdaw.pl>
AuthorDate: Thu Aug 22 07:02:00 2013 +0200
Commit: Włodzimierz Gajda <gajdaw@gajdaw.pl>
CommitDate: Thu Aug 22 07:02:00 2013 +0200
Lorem
Now you realized that the text stored in a lorem.txt file should be capitalized
and extended. To get a deeper insight into git's internals we will amend the revision un-
der different user name.
 
 
Search WWH ::




Custom Search