Git (currently) cannot handle file system meta information such as permissions, last modification time or ownership (both user and group). Here comes git-meta to fix this in some cases where these informations are mandatory or simply useful.
All informations are stored in a .gitmeta file managed itself by git.
Using git hooks may automate the backup and restore process.
- --data DATA
-
Set the git-meta database file (default: '.gitmeta').
- -f|--force
-
Force writing data even if no modification has been done in the git tree. By default git-meta does not run if no modification has been done to prevent from massive git change set creation.
- -h|--help
-
Display help screen.
- -a|--add-to-git
-
Add database to the git commit list.
- -O|--owner
-
Store symbolic file ownership to the database.
- -o|--numeric-owner
-
Store numeric file ownership to the database.
- -P|--skip-perms
-
Skip file perms during restore.
- -M|--skip-mtime
-
Skip file mtime during store/restore operations. The mtime is not written into the database.
- -U|--skip-user
-
Skip file owner during restore.
- -G|--skip-group
-
Skip group owner during restore.
- -i|--ignore BRANCH
-
Branch on witch git-meta is ignored. This is treated as a regexp. This option can be specified several times. if not specfied, values are search in the meta.ignore git configuration key.
- get
-
Store metadata to database.
- set
-
Restore metadata from database.
- dump
-
Dump metadata from database.
- init
-
Create hooks in git hooks directory.
The database format is quiet simple. It consists of a JSON dump of a dictionnary for which the file name is the key and the file attributes are the values. dictionnary.
The key is composed of the full filename path starting from the git repository root.
Each values are:
-
mode: the file permissions in decimal format.
-
mtime: the file mtime in seconds since Epoch.
-
uid: the file owner (in numerical or symbolic format).
-
gid: the file group (in numerical or symbolic format).
File ownership (both owner and group) are either:
-
Not stored at all if neighter the '-o' nor '-O' option is given. This might be used if the files ownership may change from one system to an other. Generally this should be used in almost all cases. Otherwise a large amount of changesets could pollute git commits. In that case the last 2 fields (both owner and group) of each record are not present in the database.
-
Stored in symbolic format if '-O' is given. This option should be used if symbolic ownership are the same in all systems (for keeping track of '/etc' changes for example).
-
Stored in numerical format if '-o' is given. This option should be used if numerical ownerships are the same in all systems.
- 2014/04/24
-
Add ignore option
- 2014/03/02
-
Rewite script in python
- 2011/09/11
-
Add init command.
- 2011/03/26
-
First public release.
Copyright © 2011-2014 Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>.
Relased under WTFPL (http://sam.zoy.org/wtfpl/COPYING).