From 924e308c2cab23344b4db0ebee4cd5b0c09b5c74 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Tue, 29 Sep 2020 11:12:12 +0200 Subject: [PATCH] Rename .gitignore file to not conflict with the system global .gitignore. --- .README.md | 19 +++++++++++-------- .bashrc.dotfiles | 2 +- .gitignore => .gitignore.dotfiles | 0 3 files changed, 12 insertions(+), 9 deletions(-) rename .gitignore => .gitignore.dotfiles (100%) diff --git a/.README.md b/.README.md index 2999d47..a2a92b9 100644 --- a/.README.md +++ b/.README.md @@ -6,12 +6,12 @@ Configuration files for syncing between machines. See https://www.atlassian.com/ 1. Clone the repo: ``` - $ git clone --bare https://github.com/fredrikekre/.dotfiles.git $HOME/.dotfiles.git + $ git clone --bare https://github.com/fredrikekre/.dotfiles.git "$HOME/.dotfiles.git" ``` 2. Define a temporary `dotfiles` alias: ``` - $ alias dotfiles='git --git-dir=$HOME/.dotfiles.git/ --work-tree=$HOME' + $ alias dotfiles='git --git-dir="$HOME/.dotfiles.git/" --work-tree="$HOME"' ``` 3. Check out the files: @@ -19,7 +19,15 @@ Configuration files for syncing between machines. See https://www.atlassian.com/ $ dotfiles checkout ``` -4. Add the following to the top of `.bashrc` +4. Configure the new local repo to hide untracked files and to use the local gitignore file + ``` + $ dotfiles config --local status.showUntrackedFiles no + + $ dotfiles config --local core.excludesfile "$HOME/.gitignore.dotfiles" + ``` + + +5. Add the following to the top of `.bashrc` ``` # Include cross-system common parts from .dotfiles.git repo if [ -f ~/.bashrc.dotfiles ]; then @@ -27,9 +35,4 @@ Configuration files for syncing between machines. See https://www.atlassian.com/ fi ``` -5. Configure the new local repo to hide untracked files - ``` - $ dotfiles config --local status.showUntrackedFiles no - ``` - 6. Reboot the shell diff --git a/.bashrc.dotfiles b/.bashrc.dotfiles index 44d4d01..1265a69 100644 --- a/.bashrc.dotfiles +++ b/.bashrc.dotfiles @@ -12,7 +12,7 @@ case $- in esac # dotfiles alias -alias dotfiles='git --git-dir=$HOME/.dotfiles.git/ --work-tree=$HOME/' +alias dotfiles='git --git-dir="$HOME/.dotfiles.git/" --work-tree="$HOME/"' # Common bash prompt export PS1="[\[\e[32m\e[1m\]\u@\h\[\e[0m\]:\[\e[34m\e[1m\]\w\[\e[0m\]]\$ " diff --git a/.gitignore b/.gitignore.dotfiles similarity index 100% rename from .gitignore rename to .gitignore.dotfiles