From e885aeee35699910b4f08ece45c7c97110ffe41c Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Tue, 13 Feb 2018 15:42:09 +0100 Subject: Add usage notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And simplify .gitignore. I originally added !/.* to make sure committed dotfiles would still appear in git status, but that's not necessary: > Files already tracked by Git are not affected > ― gitignore(5) The only downside is that to start tracking new dotfiles, git add will need --force. --- .gitignore | 1 - README | 27 +++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a7037b0..72e8ffc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ * -!/.* diff --git a/README b/README index a7e840d..2e537e5 100644 --- a/README +++ b/README @@ -1,4 +1,27 @@ -What's "dotfiles", precious? -What's "dotfiles" eh? +A few good dotfiles +=================== 🎜 Clone'em, tweak'em, stick'em in your $HOME 🎝 + +Usage notes +----------- + +Some Git sorcery to maximize usability and avoid brittle hacks +(e.g. symlinks, homebrewed synchronization scripts): + +``` sh +# In $HOME, prepare a Git repository: +$ git init + +# Grab history: +$ git remote add --fetch $cutename $url + +# Move to latest commit without actually touching files: +$ git reset $cutename/master + +# Checkout dotfiles that were not already in $HOME: +$ git checkout -- .gitignore # … + +# Tell Git to forget about repository fluff: +$ git update-index --assumed-unchanged -- README # … +``` -- cgit v1.2.3