четвер, 14 жовтня 2010 р.

Using git to track configs in /etc directory

Sometimes you may experience problems with configuration files, especially when you edit them manually ;)

It's generally a good habbit to keep track of all these changes, for example using git or svn. Git is more comfortable for me.

To create a git repository for /etc, you may use following commands (needs root privileges):

cd /etc
sudo su
git init
git add -A
git commit -a -m "Initial commit"
exit

Than, at any time you may look at changes using

sudo git status
and
sudo git diff | gvim -

To add file to repository, use

sudo git add <filename>

And commit changes using

sudo git commit -a -m "some comment"

Note: You should definitely read some documentation on git before using it (there are many non-intuitive behaviors).

And remember: better to train your skills on some not important directories first ;)

Немає коментарів:

Дописати коментар