Most Hippo commands are identical to their Git equivalents, and Hippo needs root privileges to perform the majority of its functions (and is thus often executed as root or with sudo.)
After installing the software, general workflow is:
- Adding the files we want to archive/track to the repository queue
- Review the files indexed
- Committing these files and any accepted changes to the repository
- Push the repository to a remote host
1. Add a file
Before we can version changes, or backup any of our hosts files, we need to add these files to the Hippo/Git repository. The Hippo/Git principles for managing repositories are to:
- Take a snapshot of the contents of new or changed file(s) to be inserted into the repository. The snapshot is called the index and taking the snapshot is done by add.
- Move the snapshot in the index into the repository with a message describing the changes made, using the command commit.
Select the files you need to track versioning, and use hippo add file-name
$ sudo hippo add /etc/inetd.conf
We use sudo because read/write access to some of the files requires root privileges.
When learning about configuration archiving, restoration, it is interesting to install/configure hippo on a new/pristine system and add all configuration files. Hippo then becomes a good tool for detecting/noting changes to your configuration settings as you install and configure services/applications.
Oops, don’t add that file
[Ref: undo git add | git-rm | git-reset ]
More often than not, I’ve jumped in and [add]()ed files that I do not
want to version. DO NOT use ‘git rm
$ sudo su
git rm -r –cached
Refer the above referenced documentation for more details.
You can always review what is currently ‘snapshotted’ or ‘staged’ into hippo/git index, by using the status command.
$ sudo hippo status
From the displayed list, you take note of the files that have changed and then make decisions for committing/removing indexed files.
[Ref: git-commit ]
Stores the current contents of the index in a new commit along with a log message from the user describing the changes
After we’ve ‘add’ a file/directory into the repository index, we can remove them, or enshrine/commit these files into the repository using commit
$ sudo hippo commit -a
The above command, including the -a tells hippo/Git to commit all index entries.
The commit command is also used to tell the repository that changes to the existing files can also be committed.
4. Push to a remote host
[Ref: git-push ]
To copy the host configuration files to a separate host (Central Repository) we use the git-push equivalent.
$ hippo push aldo@remotehost:repo master
Of course, this command presumes that the repository has already been created on the above server/remotehost.
Refer to Server/Remote host Configuration for configuring your aggregation/central host.
Refer to Shortcuts for simplifying the push process.