https://github.com/divitmittal/sync-windows
~/.* (Windows)
https://github.com/divitmittal/sync-windows
dotfiles dotfiles-windows flake-parts nix powershell windows-10 windows-11
Last synced: 7 months ago
JSON representation
~/.* (Windows)
- Host: GitHub
- URL: https://github.com/divitmittal/sync-windows
- Owner: DivitMittal
- Created: 2024-01-27T01:23:45.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-05-30T23:29:26.000Z (9 months ago)
- Last Synced: 2025-05-31T06:32:33.575Z (9 months ago)
- Topics: dotfiles, dotfiles-windows, flake-parts, nix, powershell, windows-10, windows-11
- Language: CSS
- Homepage:
- Size: 10.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: .github/README.md
Awesome Lists containing this project
README
sync-windows
 
These are dotfiles, preference files, configuration files, shell scripts, etc., tailored for a Microsoft Windows environment.
## Dotfile Synchronization with `sw`
This repository utilizes a clever technique to manage dotfiles directly within your user profile directory (`$env:userprofile`) using Git. The core of this system is the `sw` (sync-windows) alias defined in `Documents/Powershell/Profile.ps1`.
**How it works:**
The `sw` command is an alias for a PowerShell function that invokes `git` with specific parameters:
- `--git-dir=$env:userprofile/sync-windows/`: Specifies that the Git repository data (the `.git` directory, essentially) resides within this project's directory located directly under your user profile.
- `--work-tree=$env:userprofile`: Sets the working directory for Git to your entire user profile directory.
This means you can run standard Git commands using `sw` instead of `git` to track, manage, and synchronize any file within your user profile directory using this repository.
**Example Usage:**
```powershell
# Check the status of tracked files in your home directory
sw status
# Add a configuration file to be tracked
sw add .config/my-app/settings.json
# Commit changes
sw commit -m "Update my-app settings"
# Push changes to the remote repository
sw push
```
This approach allows for seamless version control and synchronization of my Windows environment configuration.