Store dotfiles in git repository

linux git
<p>Content hacked with mods from Atlassian(https: //developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/)</p> <p>Setup:</p> <pre><code>git init --bare $HOME/.dotfiles alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' dotfiles config --local status.showUntrackedFiles no echo alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' &gt;&gt; $HOME/.bashrc </code></pre> <p>Add:</p> <pre><code>config status config add .vimrc config commit -m Add vimrc config add .bashrc config commit -m Add bashrc </code></pre> <p>Remote (change to actual ssh):</p> <pre><code>git remote add origin https: //someRandomFatGuy@bitbucket.org/someRandomFatGuy/dotfiles.git </code></pre> <p>Push:</p> <pre><code>git push </code></pre> <p>Clone:</p> <pre><code>git clone --bare https: //someRandomFatGuy@bitbucket.org/someRandomFatGuy/dotfiles.git $HOME/.dotfiles function dotfiles { /usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@ } mkdir -p .dotfiles-backup dotfiles checkout if $? : 0 ; then echo Checked out dotfiles.; else echo Backing up pre-existing dot files.; dotfiles checkout 2&gt;&amp;1 | egrep \s+\. | awk {'print $1'} | xargs -I{} mv {} .dotfiles-backup/{} fi; dotfiles checkout dotfiles config status.showUntrackedFiles no </code></pre>

© 2026 Code0x378