Skip to content

war-turtle/dotfiles

Repository files navigation

What does this repo contain?

This repo contains dotfiles managed using chezmoi.

Steps

We will be calling chezmoi, cz for ease of use.

Note: cz is an alias for chezmoi command

use these files on a new laptop

  1. download cz
  2. use:
    chezmoi init [email protected]:war-turtle/dotfiles.git
    # can use https url if ssh is not setup
    
    chezmoi apply

How to update all your dotfiles

To update all you dotfiles with changes from github repo, do the following

cz cd
git pull origin main
cz diff # to view what changes will be applied
cz -v apply # to write the changes download from github to your dotfiles
    # -v is verbose flag

To add a new file/directory to cz

cz add <path-to-file/directory>
cz cd
git add .
git commit -m "<commit-msg>"
git push origin main
cz -v apply

make changes to a file managed by cz

chezmoi edit ~/.zshrc
chezmoi apply

If the file(let's take ~/.zshrc file for example) is already edited by some other program. you can use

chezmoi diff # to view the difference

chezmoi merge ~/.zshrc

In the opened vs code window, local files are on the left and files from github are on the right

you can also use merge-all to merge all the file once instead of doing it one by one

cz merge-all

If you decide to do merges one by one and want to check which all files changed use:

cz diff | grep '^+++ '

refer to faqs to read How do I edit my dotfiles with chezmoi?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published