filmov
tv
Git Bare Repository - A Better Way To Manage Dotfiles
Показать описание
I've been looking for a better way to manage my dotfiles. My old method involved moving all of my dotfiles into their own directory and then symlinking each one of them back into the directory structure. What a headache!
Using git bare repositories, there is no more moving files into an initialized git repository and then creating symlinks. Now, I just add, commit and then push. Done.
Want to make your own git bare repository? First, make a directory for your new git bare repository (I created one called "dotfiles" but you can name it whatever).
Then I entered the following in the terminal:
git init --bare $HOME/dotfiles
alias config='/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME' (add this alias to .bashrc)
bash
Basic usage example:
config add /path/to/file
config commit -m "A short message"
config push
WHAT'S THE REASON FOR THE GIT BARE REPO?
By using the git bare repo, you can have nested git repos in your home directory and there will not be any issue with keeping things straight. That is the reason for the git bare repo and having an alias ("config").
ARTICLE REFERENCED IN THE VIDEO:
💰 WANT TO SUPPORT THE CHANNEL?
👕 BUY SHIRTS AND MUGS:
Help support this channel by purchasing these fine t-shirts, hoodies and mugs.
🗨️ JOIN ME ON DIASPORA AND MASTODON:
📁 MY CONFIGS:
Your support is very much appreciated. Thanks, guys!
Using git bare repositories, there is no more moving files into an initialized git repository and then creating symlinks. Now, I just add, commit and then push. Done.
Want to make your own git bare repository? First, make a directory for your new git bare repository (I created one called "dotfiles" but you can name it whatever).
Then I entered the following in the terminal:
git init --bare $HOME/dotfiles
alias config='/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME' (add this alias to .bashrc)
bash
Basic usage example:
config add /path/to/file
config commit -m "A short message"
config push
WHAT'S THE REASON FOR THE GIT BARE REPO?
By using the git bare repo, you can have nested git repos in your home directory and there will not be any issue with keeping things straight. That is the reason for the git bare repo and having an alias ("config").
ARTICLE REFERENCED IN THE VIDEO:
💰 WANT TO SUPPORT THE CHANNEL?
👕 BUY SHIRTS AND MUGS:
Help support this channel by purchasing these fine t-shirts, hoodies and mugs.
🗨️ JOIN ME ON DIASPORA AND MASTODON:
📁 MY CONFIGS:
Your support is very much appreciated. Thanks, guys!
Комментарии