73382.5 / 01 December 2019

Manage Home Directory with Git

I wanted to show you guys how to manage your home directory files. I had several files I wanted to sync across systems and no solution satisfied me.

With this method the files are saved directly to where I want them and it even allows me to revert if something isn't what I wanted, or I find an error.

Using Git to manage your home directory. Learn more by watching this video.

{% youtube K3VkwDHGdn4 [500] [480] %}

If you don't want to watch a video simple follow this method.

1
2
# edit and add .bashrc
alias home='git --work-tree=$HOME --git-dir=$HOME/.home.git'

Then run :::bash home init

Now modify your .gitignore

1
touch .gitignore

For example in your .gitignore

1
2
3
4
# .gitignore
# keep track
!.bashrc
!.gitignore

As an example in the video I talked about adding a profile to Firefox and then tracking that folder for the userChrome.css file which allows customizations to Firefox. Here is my .gitignore paths for that. Obviously change "profile1" to by the name of your profile.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# edit .gitignore
### Firefox
### make script to rename profile to similar name..if you want to automate this process for others
!.mozilla
/.mozilla/*
!.mozilla/firefox
/.mozilla/firefox/*
!.mozilla/firefox/profile1
/.mozilla/firefox/profile1/*
!.mozilla/firefox/profile1/chrome
!.mozilla/firefox/profile1/chrome/*

In your userChrome.css file you can for example change the background color for new tabs.

1
2
3
#tabbrowser-tabpanels{
    background-color: rgb(46,54,69) !important;
}

Now additionally something I didn't cover in the video, add something to userContent.css. This will also address the white flash issue.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
@-moz-document url("about:home"),url("about:blank"),url("about:newtab"),url("about:privatebrowsing"){
    body{
        background-color: rgb(46,54,69) !important;
        color: white !important;
    }

    .activity-stream .top-site-inner .title {
    color: #fff !important;
    }
}