Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section for multi-platform workflow #2

Open
iandinwoodie opened this issue Jun 7, 2019 · 1 comment
Open

Add section for multi-platform workflow #2

iandinwoodie opened this issue Jun 7, 2019 · 1 comment

Comments

@iandinwoodie
Copy link
Owner

iandinwoodie commented Jun 7, 2019

Readers may be curious how multiple setups (e.g., a setup per platform) can be supported by this workflow.

@iandinwoodie
Copy link
Owner Author

iandinwoodie commented Sep 13, 2019

Git Clone Bare

git clone --bare $REPO_URL $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
echo ".dotfiles" >> $HOME/.gitignore
mkdir -p .dotfiles.bak \
  && dotfiles checkout 2>&1 | egrep "^\s+" | awk {'print $1'} | \
     xargs -I {} mv {} .dotfiles.bak \
  && dotfiles checkout

Git Clone Mirror

git clone --mirror $REPO_URL $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
echo ".dotfiles" >> $HOME/.gitignore
mkdir -p .dotfiles.bak \
  && dotfiles checkout 2>&1 | egrep "^\s+" | awk {'print $1'} | \
     xargs -I {} mv {} .dotfiles.bak \
  && dotfiles checkout

Pros

  • Sets up some remote tracking variables.

Cons

  • Using the remotes is complicated and leads to a lot of failed Git commands.

Git Init Separate Directory

git init --separate-git-dir $HOME/.dotfiles
git config --local status.showUntrackedFiles no
git remote add origin $REPO_URL
git fetch
mkdir -p .dotfiles.bak \
  && git checkout master 2>&1 | egrep "^\s+" | awk {'print $1'} | \
     xargs -I {} mv {} .dotfiles.bak \
  && git checkout master

Pros

  • Sets up remote tracking branches and related configuration variables.
  • Eliminates the need for a dotfile alias.

Cons

  • Places a .git file in the $HOME directory.

@iandinwoodie iandinwoodie pinned this issue Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant