{"thread":{"id":"13816","subject":"Sharing home and etc files with git","startedAt":"2008-06-05T20:01:11Z","lastAt":"2008-06-05T22:48:17Z","messageCount":3,"participants":["iiijjjiii","Miklos Vajna","Kelvie Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"78805","messageId":"48484607.5090505@gmail.com","threadId":"13816","inReplyTo":null,"subject":"Sharing home and etc files with git","fromName":"iiijjjiii","fromEmail":"iiijjjiii@gmail.com","sentAt":"2008-06-05T20:01:11Z","receivedAt":"2008-06-05T20:01:11Z","isPatch":false,"sender":{"key":"iiijjjiii@gmail.com","avatar":null},"body":"I would like to use git to keep revision histories of my home and etc \ndirectories. I have several computers and I like to keep their \nenvironments similar. I could see git pulls updating .bash_aliases, \n.bashrc, and various bash and perl scripts I create in the home \ndirectory, and updating /etc config files. Git pushes would share any \nrecent changes to other computers. This way no matter which computer I \nam working on, the environment will be similar and I can make changes \nand know they will be copied to the others.\n\nI haven't figured out a good way to deal with the files that have local \nsettings in them. Using .gitignore feels a little overkill. Only certain \nlines of the files need to be unique. Once they are set, I'd like \nsubsequent changes to be updated. I could cherry-pick manually but I'd \nlike a more automated method. I have read about etckeeper, \ngit-home-history and gibak, but they seem to be designed for backing up \nand versioning files on one computer and not for sharing files.\n\nHas anyone done something similar using git or is another tool more \nsuitable.\n\nThanks\njimk\n"},{"id":"78819","messageId":"20080605205031.GH29404@genesis.frugalware.org","threadId":"13816","inReplyTo":"48484607.5090505@gmail.com","subject":"Re: Sharing home and etc files with git","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-06-05T20:50:31Z","receivedAt":"2008-06-05T20:50:31Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Thu, Jun 05, 2008 at 04:01:11PM -0400, iiijjjiii <iiijjjiii@gmail.com> wrote:\n> I would like to use git to keep revision histories of my home and etc \n> directories.\n\nFirst, git is to track content, not permissions. So it is not the right\ntool.\n\nSecond, you can try etckeeper which does this on top of git.\n\nBut still please keep in mind that you may have serious problems, like:\nif you get a conflict in /etc/passwd, you may not be able to login,\netc...\n"},{"id":"78831","messageId":"94ccbe710806051548x485aefe8j2ad6b40b74d68747@mail.gmail.com","threadId":"13816","inReplyTo":"48484607.5090505@gmail.com","subject":"Re: Sharing home and etc files with git","fromName":"Kelvie Wong","fromEmail":"kelvie@ieee.org","sentAt":"2008-06-05T22:48:17Z","receivedAt":"2008-06-05T22:48:17Z","isPatch":false,"sender":{"key":"kelvie@ieee.org","avatar":null},"body":"On 6/5/08, iiijjjiii <iiijjjiii@gmail.com> wrote:\n> I would like to use git to keep revision histories of my home and etc\n> directories. I have several computers and I like to keep their environments\n> similar. I could see git pulls updating .bash_aliases, .bashrc, and various\n> bash and perl scripts I create in the home directory, and updating /etc\n> config files. Git pushes would share any recent changes to other computers.\n> This way no matter which computer I am working on, the environment will be\n> similar and I can make changes and know they will be copied to the others.\n>\n\nCompletely understandable; also remember that pushing, unlike pulling, does not\nupdate the working tree (and you wouldn't want it to).\n\n>  I haven't figured out a good way to deal with the files that have local\n> settings in them. Using .gitignore feels a little overkill. Only certain\n> lines of the files need to be unique. Once they are set, I'd like subsequent\n> changes to be updated. I could cherry-pick manually but I'd like a more\n> automated method. I have read about etckeeper, git-home-history and gibak,\n> but they seem to be designed for backing up and versioning files on one\n> computer and not for sharing files.\n>\n>  Has anyone done something similar using git or is another tool more\n> suitable.\n>\n\nI'm fairly certain there are tools out there for this, but what I do is I have\nall of the files that I want to add (such as ~/.${SHELL}rc, ~/.${SHELL}.d/*,\nand .emacs) into ~/.git-home; then I symlink all of these files/directories\ninto my $HOME (with a short script that's also checked in).\n\nI then throw this entire repo somewhere where all my other machines can\npull/push from, and I resolve merges as needed.  It works fairly well.\n\n-- \nKelvie Wong\n"}]}