Files
LogSeq/pages/Scripts/DotFiles.sync-conflict-20250817-085623-UULL5XD.md
2025-12-11 06:26:12 -08:00

38 lines
947 B
Markdown

---
title: DotFiles
updated: 2021-08-04 14:37:25Z
created: 2020-08-19 11:26:42Z
---
[https://www.atlassian.com/git/tutorials/dotfiles](https://www.atlassian.com/git/tutorials/dotfiles)
install git and git-lfs
```bash
apt install git git-lfs
```
setup the directory and alias
```bash
git init --bare $HOME/.cfg
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
config config --local status.showUntrackedFiles no
echo \"alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'\" >> $HOME/.bashrc
``````
example of loading stuff into the repo
```bash
config status
config add .vimrc
config commit -m \"Add vimrc\"
config add .bashrc
config commit -m \"Add bashrc\"
config push
```
init a new machine with the repo
```bash
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
echo \".cfg\" >> .gitignore
git clone --bare git@github.com:sstent/dotfiles.git $HOME/.cfg
config checkout
```