Skip to content
Avindra Goolcharan edited this page Nov 17, 2020 · 3 revisions

Installation

Make ~ a git repo. Stolen from a great StackOverflow post:

Note: cd without any arguments automatically changes to your home folder.

cd
git init

git remote add origin [email protected]:avindra/dotfiles.git
git fetch

# The -f flag will overwrite ALL files
# this is good because it makes doing updates OR full resets very easy
git checkout -f -t origin/src

⚠️ Note: Beyond this, there are some _setup* functions that need to be called at least one time manually (i.e., during the setup).

ℹ️ After the repo is cloned, most things should already be working. Be sure to see Package management next to find out what software is required.

Upgrades

Manual: Do upgrades manually with git pull. dotfile_update is a function that can be used instead, to stash local changes automatically.


Automatic: Put in crontab Do it for all devices.

Crontab integration: The following line runs an update at lunchtime every day:

As user:

30   12   * * * cd && git pull --rebase > /tmp/dotfileupdater 2>&1

or as root:

30   12   * * * /usr/bin/su - ${USER} -c 'git pull' > /tmp/dotfileupdater 2>&1

Resets

Deleting the .git folder

cd
rm -fr .git

Design

Put it in SCM.

The ~ folder is a git repository that you can push and pull directly from.

What's the limitation? That I cannot go beyond ~ (i.e., no mucking around in /etc). However, one typically doesn't want to muck about much in the /etc folder, as the defaults for a given operating system tend to be secure and well defined.

One advantage to storing your work in SCM is that setting up your environment or keeping it in sync is that this is a matter of managing the source repository.

Clone this wiki locally