Initial commit
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
# dot
|
||||
|
||||
## Description
|
||||
Dotfiles and new install guide.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Starting Fresh](#starting-fresh)
|
||||
* [Migrating](#migrating)
|
||||
* [Acknowledgments](#acknowledgments)
|
||||
* [License](#license)
|
||||
|
||||
|
||||
## Starting Fresh
|
||||
|
||||
```bash
|
||||
# Creates a folder ~/.dot which is a bare repository that will track our files.
|
||||
git init --bare $HOME/.dot
|
||||
|
||||
# create an alias config which we will use to interact with our dotfile repo.
|
||||
alias config='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'
|
||||
|
||||
# Set a LOCAL REPO flag to hide files we are not explicitly tracking yet,(all).
|
||||
dot config --local status.showUntrackedFiles no
|
||||
|
||||
# Make sure our alias is set.
|
||||
echo "alias dot='/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME'" >> $HOME/.bashrc
|
||||
```
|
||||
|
||||
## Migrating
|
||||
|
||||
```bash
|
||||
git clone --bare https://https://myrepos.dev/Randy-Jordan/dot.git $HOME/.dot
|
||||
function dot {
|
||||
/usr/bin/git --git-dir=$HOME/.dot/ --work-tree=$HOME $@
|
||||
}
|
||||
mkdir -p .dot-backup
|
||||
dot checkout
|
||||
if [ $? = 0 ]; then
|
||||
echo "Checked out dotfiles.";
|
||||
else
|
||||
echo "Backing up pre-existing dot files.";
|
||||
dot checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .dot-backup/{}
|
||||
fi;
|
||||
dot checkout
|
||||
dot config status.showUntrackedFiles no
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Acknowledgments
|
||||
[Readme Driven Development - Tom Preston-Werner](https://tom.preston-werner.com/2010/08/23/readme-driven-development.html)<br>
|
||||
[Choose a License](https://choosealicense.com/)<br>
|
||||
[Useful .gitignore Templates](https://github.com/github/gitignore)<br>
|
||||
|
||||
## License
|
||||
This project is licensed under the MIT License - see the [MIT License](LICENSE.md) file for details.
|
||||
|
||||
Reference in New Issue
Block a user