Files that start with a . in their name! They're used for the configuration of applications and software inside of a *nix based operating system (linux, macOS, unix, and BSD)
As said, dotfiles are used for configuration, but the dot at the start also makes them hidden by default, which is the actual use of the dot. In windows, your files have attributes (read only, hidden, etc) that you can enable via the properties. In Linux/Mac OS you use this feature by adding a dot at the start of the name.
This video is pure gold. It's the first time I've heard about stow and it seems like a great solution to the dot files problem. You keep to to the point and actually address the few common issues. Thank you!
I set up stow 4 or 5 years ago (however I used a sub folder per application, it's a lot cleaner and modular imo) and never had to touch it ever again, it just works. Just need to git push when I change something in a config file. Probably one of the most time saving tool I ever used.
Mine is the same way. I was starting to think I did something wrong. The `stow .` can be misleading. I have a Makefile with several helpful commands for laptop initial setup including a "stow" target that just calls stow on all the subfolders/applications.
I haven't used Stow before, but I have found it useful to write a `.git/hooks/post-commit` script that runs `git push origin ${branch}` to just do a `git push` every time I successfully create a commit. It's not the right approach for *every* use-case, but I'm forgetful, and this is an easy and simple enough Git use-case that you're unlikely to get yourself into trouble. Git hooks are awesome and waaay underappreciated for the intermediate-to-power-users. Just, uh, be careful with them. Like most things with Git, there aren't a lot of safeties built in, and it's easy to lose a finger if you're not watchful. 😂
Hey can you guys elaborate please? I wanna try out stow and I get the sense I'll also like to have sub folder & cleaner setup. Do you mean you have a different repo for each dotApp? Or you do have one but it's not mapped one-to-one on your home folder? Would love to understand what you guys did
hey @@fire17102 , I have one git repo but one folder per dotApp, so I can restore only one for example. The process is easy but difficult to explain in a comment, I found this video ruclips.net/video/FHuwzbpTTo0/видео.htmlsi=CMDaZ0dP3Hzs1pp4 that explains the process (it has also the explanation in a blog post linked in the comment section.
I started using Stow a decade ago, and it changed everything for me! Pro tip: If you do have more than one machine, you might require some dotfiles to have different content. Or you might not use all the same tools on every machine. Create different subdirs of your `dotfiles` dir, and use `stow subdir`. I will leave as an exercise for advanced users a script that can run on a new machine and auto-stow subdirs based on what that script can learn from its environment. Bonus points if it is idempotent and can install dependencies like git on its own.
Gosh, this is so simple and straightforward, plus it’s way better than what I was doing: I had a similar folder under my $HOME but I also had a bash script that you had to run which would basically rsync. Sort of a facepalm moment realizing you could just symlink _and_ automate the symlink process w/ just having stow.
Stow can also take a target directory (-t TARGET) so if you don’t want to keep your dotfiles repo directly under your home directory you can use that. For me I would do “stow -t /home/username .” From the dotfiles repo which could be anywhere.
that’s interesting. i’m curious how I would manage a config file for any program I install. they would have their config files in /etc or somewhere. how do permissions factor in with stow?
You can also use stow to keep your app configurations separate, like say if you have a tmux config for your local config, and a tmux config that is slightly different for a server, you can put all of the files in two separate folders, then instead of specifying . You use the other folder name like `stow tmux-server` or `stow tmux-local`
I do this all the time. And I have tricks to tell if I'm on a server or desktop so my scripts Stow the correct version. Or I have a folder with a host name in it (tmux-bartleby if the host name was bartleby).
@@vortex2210 While I appreciate the interest, this isn't exactly the Unix StackExchange. 😜 So I'll just give you one thing I do. I use a script to run all of the `stow` commands on a new host. And I will get the hostname with `hostnamectl status --static`, using that to stow hostname-specific subdirs.
@@vortex2210 It's difficult to get specific in YT comments. But in general the script pulls info to figure out if it's a server, desktop, or laptop. Then goes down the dotfiles subdir names. It stows everything without a dash, it then stows everything with a "-desktop" if on a desktop, "-laptop" if on a laptop, etc. Then it pulls hostname and stows "-bartleby" if hostname is "bartleby". General to specific. For certain configs that can't reasonably be split like that (for example, I use topgrade to auto upgrade everything and the config file doesn't support includes), I use the same server/desktop/laptop detection function in my manual upgrade scripts to skip running where they shouldn't.
I was super skeptical that the symlinks will make something go Boom but so far (the last 10 mins) this is working like a dream! Thank you for the top quality content!
Really blew my mind, no more bare repos, no more yadm or similar things that adds some abstraction layers, simply stow + git, all done! God, I love this!
Just stumbled upon this seemingly very new channel, seems like some awesome and high quality content. Very curious to see where you’re going with this channel, great videos so far.
This is so useful, I never even heard of stow before! Dotfiles clutter the home directory so much and this is by far the most convenient way to solve this issue, thanks.
thx for the video. I have been using stow for several years to manage my dotfiles. I advise you to consider the following options: - R || -- restow : allows you to delete all existing links and recreate all links. As iniquated in the manual: « This is useful for trimming obsolete symbolic links of the target tree after updating -the software in a package- - > your git dotfiles repo. -- dotfiles: All files starting with « dot- » will be linked by the replacement « dot- » by « » ".". Example dot-zshrc ->.zshrc -- ignore: does not take into account the indicated paths, practical for not using configurations depending on the type of machine (workstation or server).
I heard about stow forever ago but didn't know how to use it. I read some of the official docs but my eyes glazed over and I gave up. This video convinced me to give it a go.
holy shit. why is this not talked about more? i've been using linux as my daily driver for a year now and this is the first time i've heard anyone talk about this. this is a freaking game changer
I've been using linux as my daily driver for 10+ years and after watching this video I'm still not sure what the need is for this? It creates symlinks to your dotfiles into another location? Okay...but why? Just to make using git easier? Sure I make occasional changes to dotfiles but not so often that it justifies a version management process. I have several backups of varying age I can refer to if needed.
@@chocolate_squiggle I use Git to track all my dotfiles, including my Neovim configuration, tmux configuration, aliases, terminal color scheme, etc. All my machines use a common base, but there is some natural variation between my personal laptop, work machine, development servers at work, and so on. Compared to using a bare Git repository, I can instead track both "aws-personal" and "aws-work" (for instance) in my single dotfiles repo and use GNU Stow to deliberately pick and choose what config files I need when setting up a new machine.
@@chocolate_squiggleit really depends on how you drive... having more than just 1 computer and a complex preference it can help. anyhow sprinkle scripts, brew and ansible on it and you can have a new install running in no time...
This is a neat find! I had rolled out my own script to sort of do this, but I'd manually have to add any new tool to that script. This automates that portion. Thanks for sharing, will give it a go
Thanks! Beautifully made video and covered exactly what I wanted to know! One option I wish stow had was overwriting the conflicting files with the files from the git folder, not just the other way around. Apparently you can --adopt and then revert the changes to the git folder but that doesn't seem all that clean either.
Just fighting with how to add some more organization to my dotfiles. For once, the algorithm did not lead me down a rabbit hole of distraction- it read my mind. Thank you!
I've used rcm for many years. It has the added benefit of prepending a dot to all files and folders in the top level of your dotfiles folder, thus allowing us to use ls normally (e.g. dotfiles/config symlinks to ~/.config).
I switched from manual configuration to stow to chezmoi to ansible. Now I'm not looking back. Ansible is a perfect fit (for me) to manage dotfiles and much more. Every other solutions were making things very rigid: it was hard when not impossible to manage multiple systems, symlinks were often causing sneaky problems to some programs, it was unnatural to deploy only a subset of the dotfiles. But the best part with ansible in my opinion is that it can also manage system configuration (packages to install, /etc, or basically anything I need). Now when I need to deploy my config to a new device, I just run all my playbooks and voilà. I don't even have to remember which programs to install, what were my firewall rules, where to put that custom systemd service file. Ansible handles all that for me in a very customizable way.
I learned about chezmoi and have been using before learning about stow from this video. Will try ansible, but chezmoi has felt unnecessarily complex and unwieldy, and stow seems the right amount of simplicity to me. The symlink issue does sound real though. Do you have any recommended guides on getting started with ansible?
Mind sharing your dotfiles, i am struggling how to split configs for multiple devices nicely and sharing roles in ansible I can see why people use ansible, i never broke anything while porting my old dotfiles to it, it just shows how hard it is to shoot yourself into the foot (running with --check / --diff)
That's right, I forgot about ansible. That was a skill I wanted to pick up anyways. I might try and look up some resources on managing system config and dotfiles. Anything you'd recommend?
@@JChen7 actually, issues with symlinks is what ended up convincing me to migrate to something else. Can't remember what were the issues exactly. Though I agree with you: ansible is more complex and involved than any other solution that just aims at handling your dotfiles. I'm very used to ansible and some other iaas tools because I use them at work, so that's not really an issue for me, but it might be for many people. Still worth learning IMHO.
@@alexstone691 I'd love too, but I'd need to get rid of some personal stuff first, and I'm kind of burned out RN 😟. I think you can follow any starter guide for ansible. The only trick is to set your only host in inventory to localhost, then for multi-devices you may have a tiny wrapper script that runs your playbook some variables to identify your host. I haven't found a way to handle this elegantly in the inventory either.
kinda funny, but this is how my dotfiles are currently setup, i just have a script that symlinks them myself. some i don't, such as files i have to merge between personal and work stuff, but yeah . . i can replace that entire script with one command .. wild. awesome vid!
I used to have arch on my pc... Long time ago. Now i'm mac user, but still, if i'll have to choose distro - it will be arch. Because Arch has best wiki and require some knowledge and approach :) love your videos, keep going
@InsanceFirebat Great video on an important subject. As a developer, all those configurations are an often overlooked piece of information to backup. Stow is a good solution for single-machine environment, but when you have multiple machines or virtual machines with different needs, I would suggest RCM. RCM supports tags, whereby the environment can be named. So, common things (git, tmux, etc) configurations can all be shared, but shell environment (.zshrc, per-machine scripts, etc) can be unique to each machine.
On my side I switched to dotbot with comprehensive scripts that handle package installations for various tools like LSP servers for Neovim, terminal, window manager, etc. Setting it up initially took some time, but now on a new machine, I can execute a single script to install everything at once. Additionally, I have another script that efficiently uninstalls packages and removes symlinks.
What a great tool! I have been struggling with a homegrown solution in a Makefile, but this is so much better. Though I have been using Syncthing to keep the directory synchronised between machine instead of Git. Just so I don't need to remember to commit, push and pull changes.
Seems like a nice solution that fits between manual symlinking and Ansible. For those who have time to learn Ansible or already know it, I'd recommend setting up Ansible roles instead to automate the sh*t out of your dotfiles.
Thank you very much, for half a year I played with windows manager and I was constantly updating my dotfiles on many pc and it was really annoying, this method seems great I'm on my way to try it !
00:00 🔧 Managing DOT files was initially complex with the Atlassian guide. 00:17 🌟 Discovery of GNU Stow significantly improved DOT file management. 00:29 📁 Created a new directory for DOT files in the home folder. 00:39 🗂 Copied zshrc file into the DOT files directory and renamed the original. 01:21 🔄 GNU Stow creates symlinks for organized DOT files. 02:00 📦 Installed Stow using the package manager and linked zshrc. 02:25 🗃 Enabled version control by turning the DOT files directory into a Git repository. 03:03 🚫 Stow ignores certain files/directories by default, like .git. 04:07 ✏ Edits to symlinked files reflect in the DOT files directory. 04:36 📂 Added alacritty config by mirroring home folder structure. 05:56 🌐 Created a remote Git repository on GitHub for DOT files. 07:04 📄 Added a README file for documentation on setting up DOT files.
I manage my dotfiles manually with git. Made a ~/.dots directory, moved most my configs there and symlinked them back to the right places. Created a git repo in there and everything just works no problem (tho I made the mistake of putting a GPG key on the repo). It's kinda like using stow, but I just do the symlinks myself. Deployment is also easy because it only really needs coreutils (and optionally git and gnupg for managing the repo).
Very nice seeing your take on stow. I've been using a setup with stow for years now and it's really great. BTW you don't need to set your files as if they were in the home directory... I find that to be not so organized, specially if you have machines that use different setups, like one for your mac and one for your linux. Alternatively you can pass down some flags to stow to specify the target DIR... so I made a custom script to do that and I have a "packages" folder in my dotfiles where those configurations live pretty much like "packages", which are "stowable" configs I can pick and chose. Like a ".dotfiles/packages/encfs" is a config I can stow on linux while ".dotfiles/packages/macos-encfs" I can stow on apple machines That's close to stow's original use case as it was created as a way to maintain multiple package versions, like multiple different installations of PERL with different symlink files. Stow is also smart enough to handle complex situations where configurations would conflict.... stow will by default symlink the upmost directory / file and then recriate symlinks automatically in a more granular manner to acomodate other "stow installations" you make using the same ownership (read the docs for more info)... it sounds complicated but it isn't once you see it in action. It's pretty genius the way stow handles itself in the file tree. In practice what it means is that you could have a ZSH config for example that is your general config in a public ".dotfiles" repo "installed" at the same time as a personal ".dotfiles" ZSH config that lives in a private repo and has some custom bindings you might not wanna share publicly 😉 Anyway, if you are reading this comment up to this point maybe you could have a fun weekend project by feeding the Stow's Manual Page to ChatGPT and asking it to help you set it up. My strategy is to keep all created symlinks proxied in an "installed" folder, also in the ".dotfiles" but gitignored, to be more organized and to help stow because of how it handles Ownership ( and handles conflicts ) Here's some documentation reference in case you go this far: www.gnu.org/software/stow/manual/stow.html#Ownership Good luck Unix Adventurer!
Hey dude this video is brilliant I can now stop acting like a Neanderthal, with regard to how I manage my dot files. I always felt I was walking a tight rope making changes to my zshrc files that may or may not break without having a clean way to revert changes instead relying on manual backing up files with .back2 .back3 ad infinitum. Using stow alongside git is going to be fantastic so I thank you most wholeheartedly for making this video
As great as this video is, thanks to the RUclips algorithm, I have discovered an even better approach that using stow and that is ansible. It’s a bit of a beast compared to stow, but its power makes it worth taking the time to learn how to use it rather than the comparitive simplicity of stow. I’ve setup my dot files config with all the steps in this video, but that will effectively last for less than 2 days as I prepare to migrate to ansible!
stow is great and I used it for over a year. Would also suggest building out an ANSIBLE role that completely configures any number of machines fully to the way you like it. Another great option is a lightweight container image with zsh and a config repo/sshkey baked in.
thank you so much for this video, I haven't heard of Stow before. my dotfiles repo was the most atrocious thing ever lmao this is gonna be a fun weekend to update all that
I didn’t even have a dot files repo, so I’ve really been dragging my knuckles along the floor, but not for much longer after discovering stow via this video
I think this has convinced me to make a switch again in how my dotfiles were being setup. I was following my friend who initially did shell scripting configs, then I ended up switching to Ansible. Still trying to figure it out as I am trying to make different use case dotfiles (e.g. work, personal etc). But I think I'll do a switch at some point and figure out the logistics later - thanks for this video!
put stuff in subfolders to group your dotfiles, like "zsh" or "Alacritty". That way, you can choose which dotfiles to restore and use the same dotfiles repo in vastly different environments. You can even have multible versions of the same dotfiles and switch between them easily
@@user-sq1oi9qp8w just create a subfolder in your dotfiles directory and move files to it. Then run stow --adopt [name of subfolder] from the dotfiles directory
@@mkum2141 man is probably your friend. read the program arguments and test them in an isolated subdirectory because every command in stow is relative to the current dir if you don't use the -d and -t switches.
I've been developing my own config files sync program for the last few weeks. Now I see this and makes my whole project useless since this is so much better 😭
Great video. Thank you. I manage my dotfiles in a similar way but without stow. I have created a bash script that creates all required symlinks for me. With this setup, I can get rid of the .config folder in the dotfiles folder which makes the structure more readable.
I use vcsh to manage my entire ~. It allows me to put ~ into multiple git repositories. So I can have a repo for history files, one for desktop systems, some for a base home dir, etc.
Heard about stow about a year ago but seemed awkward. Instead I've been writing one too many 'ln -s' in my setup scripts and it dayum it might be about time. Ye've truly pushed to try stow, cheers mate. Can't wait for the self-hosted git server vid!
Seriously, only thing I don't use nixos for anymore is proxmox containers (all my vms are nixos), and that's solely because the lxc file made by hydra is almost always broken as shit
Your Videos are very promising. I already recommended your channel to several collegues. How about a part 2, how to handle .env files (or an alternative) with secrets and keys properly?
Stow is definitely useful and way better than manually linking, but for dotfiles, thoughtbot/rcm is THE way to go: easy way to make a real .dotfile a symlink with 1 “mkrc” command (so no need copy first before you call stow), or the other ay around. It has its own rc file to remember what to include and exclude, and other nice features, like support for tags for some or all dotfiles if you differentiate work and home, Mac and Linux setup etc.
2:48 FYI: You don't need to capitalize the "Y". You don't even need to type anything, just press enter. It being capitalized in the text just means that it's the default.
Not knowing Stow existed, I've been using my own script that does the same thing and has all the features in this video. Could've saved some time there 🙃
Just want to point out that in the 'stow' docs they state that it was originally used with individual packages "The examples in this manual will use /usr/local/stow as the stow directory, so that individual packages will be, for example, /usr/local/stow/perl and /usr/local/stow/emacs. " So there will be 'stow' directory, or 'dotfiles' directory and inside of it there will be the replicas of the folder.
I use yadm, it is much more easier because you don't have to worry about creating a separate folder, it uses bare repository but is a complete wrapper on Git. Just create the file where it is supposed to be and run "yadm add FILE" then "yadm commit -m 'fix: issue with my FILE'" then "yadm push". It also have things like templating for cases where you want to run some logic based on the OS and other factors. And to end it all, you can add a bootstrap script that can be run on new systems, useful for when you want to create a reproduceable setup.
I use a bare repo, btw. That way I don't even need symlinks, all I need to do is create a bare repo (which basically means only creating the .git directory), add an alias, do some minor config on the repo, and I'm good to go. Updating my dotfiles is as easy as editing them, then doing "dotfiles add -u && dotfiles commit -m "message" && dotfiles push". Getting them on my other computer is just "dotfiles pull".
I simply created a shell script that created symlinks for each of my dotfiles. Stow will make it much easier and prevent me from having to add each new dotfile to the script
wtf are dotfiles?
Files that start with a . in their name!
They're used for the configuration of applications and software inside of a *nix based operating system (linux, macOS, unix, and BSD)
As said, dotfiles are used for configuration, but the dot at the start also makes them hidden by default, which is the actual use of the dot.
In windows, your files have attributes (read only, hidden, etc) that you can enable via the properties. In Linux/Mac OS you use this feature by adding a dot at the start of the name.
😂
@@dreamsofautonomy ah yes, the garbage that shows up in my shared directories
@@NickCombs Unless it's a .DS_Store file, it's most likely not garbage though
20+ years Linux user here, never heard of Stow before... I will definitely check this out! Thanks for making this video.
This video is pure gold. It's the first time I've heard about stow and it seems like a great solution to the dot files problem. You keep to to the point and actually address the few common issues. Thank you!
Glad you enjoyed it!
No more bash for loops to copy files and create their symlinks! This is soooo good! Thank you!
git bare repo also solved this problem and you don't even need symlinks
Probably the best overview of Stow I've ever seen!
Thank you!
I used to perform ‘ln -s’ multiple times
This is useful ! Thank you for making the video on introducing stow and how to use it.
I set up stow 4 or 5 years ago (however I used a sub folder per application, it's a lot cleaner and modular imo) and never had to touch it ever again, it just works. Just need to git push when I change something in a config file. Probably one of the most time saving tool I ever used.
Mine is the same way. I was starting to think I did something wrong. The `stow .` can be misleading. I have a Makefile with several helpful commands for laptop initial setup including a "stow" target that just calls stow on all the subfolders/applications.
I haven't used Stow before, but I have found it useful to write a `.git/hooks/post-commit` script that runs `git push origin ${branch}` to just do a `git push` every time I successfully create a commit. It's not the right approach for *every* use-case, but I'm forgetful, and this is an easy and simple enough Git use-case that you're unlikely to get yourself into trouble.
Git hooks are awesome and waaay underappreciated for the intermediate-to-power-users. Just, uh, be careful with them. Like most things with Git, there aren't a lot of safeties built in, and it's easy to lose a finger if you're not watchful. 😂
Hey can you guys elaborate please? I wanna try out stow and I get the sense I'll also like to have sub folder & cleaner setup. Do you mean you have a different repo for each dotApp? Or you do have one but it's not mapped one-to-one on your home folder? Would love to understand what you guys did
hey @@fire17102 , I have one git repo but one folder per dotApp, so I can restore only one for example. The process is easy but difficult to explain in a comment, I found this video ruclips.net/video/FHuwzbpTTo0/видео.htmlsi=CMDaZ0dP3Hzs1pp4 that explains the process (it has also the explanation in a blog post linked in the comment section.
@@LudoTechWorld Thanks I'll take a look! 💛😇🦄 All the best!
I started using Stow a decade ago, and it changed everything for me!
Pro tip: If you do have more than one machine, you might require some dotfiles to have different content. Or you might not use all the same tools on every machine. Create different subdirs of your `dotfiles` dir, and use `stow subdir`.
I will leave as an exercise for advanced users a script that can run on a new machine and auto-stow subdirs based on what that script can learn from its environment. Bonus points if it is idempotent and can install dependencies like git on its own.
If only there was more than 24h in a day.... 😂
You can also create a seperate branch in the git repo.
@@oberfeldwedler9999 Branch management for this doesn't scale as well for me. I want to be able to see everything all at once.
you can literally just "ln -s" bro 🤡😏
@@KingZero69 Tell us you didn't watch the video and haven't read the manpage for stow without telling us. 🤣 Go back to Windows.
I love how you explain how to push things to a remote to people that care about dotfiles management.
Though it could have started with turning the computer on!
@@trunejtral you never know. there could be kids watching! :D
for real 😂
Gosh, this is so simple and straightforward, plus it’s way better than what I was doing: I had a similar folder under my $HOME but I also had a bash script that you had to run which would basically rsync. Sort of a facepalm moment realizing you could just symlink _and_ automate the symlink process w/ just having stow.
Stow can also take a target directory (-t TARGET) so if you don’t want to keep your dotfiles repo directly under your home directory you can use that. For me I would do “stow -t /home/username .” From the dotfiles repo which could be anywhere.
that’s interesting. i’m curious how I would manage a config file for any program I install. they would have their config files in /etc or somewhere. how do permissions factor in with stow?
@@samifouad You could do the same with the root account. I'm not that sure about all the implications, though.
Thanks, they makes things much more convenient
Here is my stow command to put in a script or a Makefile: `stow --verbose --restow --target=$HOME --dotfiles $(dirname $0)`
You can also use stow to keep your app configurations separate, like say if you have a tmux config for your local config, and a tmux config that is slightly different for a server, you can put all of the files in two separate folders, then instead of specifying . You use the other folder name like `stow tmux-server` or `stow tmux-local`
I do this all the time. And I have tricks to tell if I'm on a server or desktop so my scripts Stow the correct version. Or I have a folder with a host name in it (tmux-bartleby if the host name was bartleby).
@@klfjoat Can you please elaborate on the structure and commands used?
@@vortex2210 While I appreciate the interest, this isn't exactly the Unix StackExchange. 😜 So I'll just give you one thing I do. I use a script to run all of the `stow` commands on a new host. And I will get the hostname with `hostnamectl status --static`, using that to stow hostname-specific subdirs.
Or you can use git branches :)
@@vortex2210 It's difficult to get specific in YT comments. But in general the script pulls info to figure out if it's a server, desktop, or laptop. Then goes down the dotfiles subdir names. It stows everything without a dash, it then stows everything with a "-desktop" if on a desktop, "-laptop" if on a laptop, etc. Then it pulls hostname and stows "-bartleby" if hostname is "bartleby". General to specific.
For certain configs that can't reasonably be split like that (for example, I use topgrade to auto upgrade everything and the config file doesn't support includes), I use the same server/desktop/laptop detection function in my manual upgrade scripts to skip running where they shouldn't.
I was super skeptical that the symlinks will make something go Boom but so far (the last 10 mins) this is working like a dream! Thank you for the top quality content!
Really blew my mind, no more bare repos, no more yadm or similar things that adds some abstraction layers, simply stow + git, all done! God, I love this!
Glad it helped!
Just stumbled upon this seemingly very new channel, seems like some awesome and high quality content. Very curious to see where you’re going with this channel, great videos so far.
This is so useful, I never even heard of stow before! Dotfiles clutter the home directory so much and this is by far the most convenient way to solve this issue, thanks.
thx for the video. I have been using stow for several years to manage my dotfiles. I advise you to consider the following options:
- R || -- restow : allows you to delete all existing links and recreate all links. As iniquated in the manual: « This is useful for trimming obsolete symbolic links of the target tree after updating -the software in a package- - > your git dotfiles repo.
-- dotfiles: All files starting with « dot- » will be linked by the replacement « dot- » by « » ".". Example dot-zshrc ->.zshrc
-- ignore: does not take into account the indicated paths, practical for not using configurations depending on the type of machine (workstation or server).
I heard about stow forever ago but didn't know how to use it. I read some of the official docs but my eyes glazed over and I gave up. This video convinced me to give it a go.
I was managing my own symlinks for this time. I though that stow was more complex but I was wrong. Thank you for this amazing and pleasant video!!
Very nice explanation, and channel! Keep up the good work! I would love to see a video showing your tmux customization.
holy shit. why is this not talked about more? i've been using linux as my daily driver for a year now and this is the first time i've heard anyone talk about this. this is a freaking game changer
I've been using linux as my daily driver for 10+ years and after watching this video I'm still not sure what the need is for this? It creates symlinks to your dotfiles into another location? Okay...but why? Just to make using git easier? Sure I make occasional changes to dotfiles but not so often that it justifies a version management process. I have several backups of varying age I can refer to if needed.
@@chocolate_squiggle I use Git to track all my dotfiles, including my Neovim configuration, tmux configuration, aliases, terminal color scheme, etc. All my machines use a common base, but there is some natural variation between my personal laptop, work machine, development servers at work, and so on. Compared to using a bare Git repository, I can instead track both "aws-personal" and "aws-work" (for instance) in my single dotfiles repo and use GNU Stow to deliberately pick and choose what config files I need when setting up a new machine.
@@chocolate_squiggle using git is never unjustified. Zero cost, huge benefit.
@@chocolate_squiggleit really depends on how you drive... having more than just 1 computer and a complex preference it can help. anyhow sprinkle scripts, brew and ansible on it and you can have a new install running in no time...
@@chocolate_squigglei feel the same so far. Even without. My normal repo method has me spinning up my setup elsewhere pretty quick
This is a neat find! I had rolled out my own script to sort of do this, but I'd manually have to add any new tool to that script. This automates that portion. Thanks for sharing, will give it a go
Thanks! Beautifully made video and covered exactly what I wanted to know!
One option I wish stow had was overwriting the conflicting files with the files from the git folder, not just the other way around. Apparently you can --adopt and then revert the changes to the git folder but that doesn't seem all that clean either.
I'm using linux a long time ,never heard stow before ,thank a lot , respect!
Just fighting with how to add some more organization to my dotfiles.
For once, the algorithm did not lead me down a rabbit hole of distraction- it read my mind. Thank you!
I've used rcm for many years. It has the added benefit of prepending a dot to all files and folders in the top level of your dotfiles folder, thus allowing us to use ls normally (e.g. dotfiles/config symlinks to ~/.config).
Is rcm still being maintained? It looks like the last commit (and release) was in 2022
I was about 24 hours from setting up a bare repo like every other tutorial, and then this came out! Perfectly timed!
I switched from manual configuration to stow to chezmoi to ansible. Now I'm not looking back. Ansible is a perfect fit (for me) to manage dotfiles and much more. Every other solutions were making things very rigid: it was hard when not impossible to manage multiple systems, symlinks were often causing sneaky problems to some programs, it was unnatural to deploy only a subset of the dotfiles. But the best part with ansible in my opinion is that it can also manage system configuration (packages to install, /etc, or basically anything I need). Now when I need to deploy my config to a new device, I just run all my playbooks and voilà. I don't even have to remember which programs to install, what were my firewall rules, where to put that custom systemd service file. Ansible handles all that for me in a very customizable way.
I learned about chezmoi and have been using before learning about stow from this video. Will try ansible, but chezmoi has felt unnecessarily complex and unwieldy, and stow seems the right amount of simplicity to me. The symlink issue does sound real though. Do you have any recommended guides on getting started with ansible?
Mind sharing your dotfiles, i am struggling how to split configs for multiple devices nicely and sharing roles in ansible
I can see why people use ansible, i never broke anything while porting my old dotfiles to it, it just shows how hard it is to shoot yourself into the foot (running with --check / --diff)
That's right, I forgot about ansible. That was a skill I wanted to pick up anyways. I might try and look up some resources on managing system config and dotfiles. Anything you'd recommend?
@@JChen7 actually, issues with symlinks is what ended up convincing me to migrate to something else. Can't remember what were the issues exactly. Though I agree with you: ansible is more complex and involved than any other solution that just aims at handling your dotfiles. I'm very used to ansible and some other iaas tools because I use them at work, so that's not really an issue for me, but it might be for many people. Still worth learning IMHO.
@@alexstone691 I'd love too, but I'd need to get rid of some personal stuff first, and I'm kind of burned out RN 😟. I think you can follow any starter guide for ansible. The only trick is to set your only host in inventory to localhost, then for multi-devices you may have a tiny wrapper script that runs your playbook some variables to identify your host. I haven't found a way to handle this elegantly in the inventory either.
kinda funny, but this is how my dotfiles are currently setup, i just have a script that symlinks them myself. some i don't, such as files i have to merge between personal and work stuff, but yeah . . i can replace that entire script with one command .. wild. awesome vid!
Woah, this is incredibly useful. Thank you so much! Here's hoping more people spread the knowledge about _stow_
Very cool. Will implement this weekend. Thanks for the great video, you're awesome.
Found out about stow a few months back when trying to manage my dotfiles
Hope this video spreads its utilization
I used to have arch on my pc... Long time ago. Now i'm mac user, but still, if i'll have to choose distro - it will be arch. Because Arch has best wiki and require some knowledge and approach :) love your videos, keep going
@InsanceFirebat Great video on an important subject. As a developer, all those configurations are an often overlooked piece of information to backup. Stow is a good solution for single-machine environment, but when you have multiple machines or virtual machines with different needs, I would suggest RCM. RCM supports tags, whereby the environment can be named. So, common things (git, tmux, etc) configurations can all be shared, but shell environment (.zshrc, per-machine scripts, etc) can be unique to each machine.
You can also manage this in git with branches
This is godsend, was planning on having a dotfiles repo but I was overwhelmed by the sheer amount of guides out there that seemed too opinionated.
quick tip, you can use ctrl+l to clear the screen instead of running the clear command, works by out of the box in most shells
yes, but the author wants to show he's clearing the screen so he uses the clear command to be more explicit
On my side I switched to dotbot with comprehensive scripts that handle package installations for various tools like LSP servers for Neovim, terminal, window manager, etc. Setting it up initially took some time, but now on a new machine, I can execute a single script to install everything at once. Additionally, I have another script that efficiently uninstalls packages and removes symlinks.
Amazing. I didn't use symlinks, but stow will help me a lot in setting up my configuration scripts. Thanks a lot.
Great video! I was using stow for a while but switched to Tuckr for my dotfiles.
I'm gonna add Tuckr to my list of things to check out! Thanks for the rec!
Nice video, I've been using stow for a long time, but for each application I use a sub folder and in git I use a branch for each hardware or use !!!
Wooo that's a good take!
Underrated channel man. Keep it up!
amazing thanks now i can safely install and migrate to arch linux
Quite possibly the best solution for dotfiles. Thanks for this!
your fonts are pure treat
What a great tool! I have been struggling with a homegrown solution in a Makefile, but this is so much better. Though I have been using Syncthing to keep the directory synchronised between machine instead of Git. Just so I don't need to remember to commit, push and pull changes.
First time to know about Stow. Will try it soon. Thank you 👍
Amazing tutorial, very easy and straight to the point!
Seems like a nice solution that fits between manual symlinking and Ansible.
For those who have time to learn Ansible or already know it, I'd recommend setting up Ansible roles instead to automate the sh*t out of your dotfiles.
Awesome channel, already watched 66% 😉, looking forward to much more!!!
Thank you very much, for half a year I played with windows manager and I was constantly updating my dotfiles on many pc and it was really annoying, this method seems great I'm on my way to try it !
You are welcome!
Great video, I've already put my vim config in git. Now I can put the rest of my setup in there as well. Much appreciated!
00:00 🔧 Managing DOT files was initially complex with the Atlassian guide.
00:17 🌟 Discovery of GNU Stow significantly improved DOT file management.
00:29 📁 Created a new directory for DOT files in the home folder.
00:39 🗂 Copied zshrc file into the DOT files directory and renamed the original.
01:21 🔄 GNU Stow creates symlinks for organized DOT files.
02:00 📦 Installed Stow using the package manager and linked zshrc.
02:25 🗃 Enabled version control by turning the DOT files directory into a Git repository.
03:03 🚫 Stow ignores certain files/directories by default, like .git.
04:07 ✏ Edits to symlinked files reflect in the DOT files directory.
04:36 📂 Added alacritty config by mirroring home folder structure.
05:56 🌐 Created a remote Git repository on GitHub for DOT files.
07:04 📄 Added a README file for documentation on setting up DOT files.
Beautifully done. Amazing tool, thank you!
This looks so wonderful! Thank you!
Thanks for the great video. I personally use rcm but will give stow a try.
I've been using Stow for two years now, with Git to sync my changes across my Mac and Windows WSL2 machines. Like the simplicity.
I manage my dotfiles manually with git. Made a ~/.dots directory, moved most my configs there and symlinked them back to the right places. Created a git repo in there and everything just works no problem (tho I made the mistake of putting a GPG key on the repo). It's kinda like using stow, but I just do the symlinks myself. Deployment is also easy because it only really needs coreutils (and optionally git and gnupg for managing the repo).
Very nice seeing your take on stow. I've been using a setup with stow for years now and it's really great.
BTW you don't need to set your files as if they were in the home directory... I find that to be not so organized, specially if you have machines that use different setups, like one for your mac and one for your linux.
Alternatively you can pass down some flags to stow to specify the target DIR... so I made a custom script to do that and I have a "packages" folder in my dotfiles where those configurations live pretty much like "packages", which are "stowable" configs I can pick and chose. Like a ".dotfiles/packages/encfs" is a config I can stow on linux while ".dotfiles/packages/macos-encfs" I can stow on apple machines
That's close to stow's original use case as it was created as a way to maintain multiple package versions, like multiple different installations of PERL with different symlink files. Stow is also smart enough to handle complex situations where configurations would conflict.... stow will by default symlink the upmost directory / file and then recriate symlinks automatically in a more granular manner to acomodate other "stow installations" you make using the same ownership (read the docs for more info)... it sounds complicated but it isn't once you see it in action. It's pretty genius the way stow handles itself in the file tree. In practice what it means is that you could have a ZSH config for example that is your general config in a public ".dotfiles" repo "installed" at the same time as a personal ".dotfiles" ZSH config that lives in a private repo and has some custom bindings you might not wanna share publicly 😉
Anyway, if you are reading this comment up to this point maybe you could have a fun weekend project by feeding the Stow's Manual Page to ChatGPT and asking it to help you set it up. My strategy is to keep all created symlinks proxied in an "installed" folder, also in the ".dotfiles" but gitignored, to be more organized and to help stow because of how it handles Ownership ( and handles conflicts ) Here's some documentation reference in case you go this far: www.gnu.org/software/stow/manual/stow.html#Ownership
Good luck Unix Adventurer!
Thank you. This sounds like it’s exactly what I’m looking for. Looking forward to digging into this as my next project
thank u so much, i tried to write a script to manage my dotfiles and almost just deleted them, i really needed this thank u so much
last time i used stow was about a decade ago. but it's interesting and i may change my setup.
good video
Hey dude this video is brilliant I can now stop acting like a Neanderthal, with regard to how I manage my dot files. I always felt I was walking a tight rope making changes to my zshrc files that may or may not break without having a clean way to revert changes instead relying on manual backing up files with .back2 .back3 ad infinitum. Using stow alongside git is going to be fantastic so I thank you most wholeheartedly for making this video
I use a bare repo and a few handy aliases but I like stow will try it thank you for this amazing video!
As great as this video is, thanks to the RUclips algorithm, I have discovered an even better approach that using stow and that is ansible. It’s a bit of a beast compared to stow, but its power makes it worth taking the time to learn how to use it rather than the comparitive simplicity of stow. I’ve setup my dot files config with all the steps in this video, but that will effectively last for less than 2 days as I prepare to migrate to ansible!
Wow, I instantly switched to stow after this video. Thanks!
stow is great and I used it for over a year. Would also suggest building out an ANSIBLE role that completely configures any number of machines fully to the way you like it. Another great option is a lightweight container image with zsh and a config repo/sshkey baked in.
thank you so much for this video, I haven't heard of Stow before. my dotfiles repo was the most atrocious thing ever lmao
this is gonna be a fun weekend to update all that
I didn’t even have a dot files repo, so I’ve really been dragging my knuckles along the floor, but not for much longer after discovering stow via this video
You created a new channel without knowing it!!!! :OOOO
Insta-subscribed
Thank you very much for this brilliant idea!
I think this has convinced me to make a switch again in how my dotfiles were being setup. I was following my friend who initially did shell scripting configs, then I ended up switching to Ansible. Still trying to figure it out as I am trying to make different use case dotfiles (e.g. work, personal etc). But I think I'll do a switch at some point and figure out the logistics later - thanks for this video!
Nixos is great for having a set for work then personal etc
@@itstoxicqt sorry just saw this after finally deciding to revisit and finally being the migration process to stow. Thanks very much!
put stuff in subfolders to group your dotfiles, like "zsh" or "Alacritty". That way, you can choose which dotfiles to restore and use the same dotfiles repo in vastly different environments. You can even have multible versions of the same dotfiles and switch between them easily
I gotta try this . But I probably won’t
how to switch
@@user-sq1oi9qp8w just create a subfolder in your dotfiles directory and move files to it. Then run stow --adopt [name of subfolder] from the dotfiles directory
Can you go into more detail as to how this works and how we can do it?
@@mkum2141 man is probably your friend. read the program arguments and test them in an isolated subdirectory because every command in stow is relative to the current dir if you don't use the -d and -t switches.
Love this approach! I also was using a bare git setup but found it hard to work with. I'll switch to this way from now on
I've been developing my own config files sync program for the last few weeks. Now I see this and makes my whole project useless since this is so much better 😭
Great video. Thank you. I manage my dotfiles in a similar way but without stow. I have created a bash script that creates all required symlinks for me. With this setup, I can get rid of the .config folder in the dotfiles folder which makes the structure more readable.
I'd love to see this bash script!
Very well made and higly informative. Keep it up!
great video! i expected this channel to have at least 50k subs lmao. great production quality
his main channel has 90k it's called dreams of code you should check it out
I use vcsh to manage my entire ~. It allows me to put ~ into multiple git repositories. So I can have a repo for history files, one for desktop systems, some for a base home dir, etc.
I used to do pretty much the exact same thing manually, but GNU stow seems nice. I'll give it a try.
Heard about stow about a year ago but seemed awkward. Instead I've been writing one too many 'ln -s' in my setup scripts and it dayum it might be about time. Ye've truly pushed to try stow, cheers mate. Can't wait for the self-hosted git server vid!
when is “since i use nixOS, btw” coming to DoA 🙏
Seriously, only thing I don't use nixos for anymore is proxmox containers (all my vms are nixos), and that's solely because the lxc file made by hydra is almost always broken as shit
Also doa if you read this you probably want nixos *and* home manager
Fr
@@andremaldonado7410 Or simply a good flake setup, managing the entire system (so both the home directory and the system)
Me and the boys using nix modules to setup common logic on a whole network of machines
Your Videos are very promising. I already recommended your channel to several collegues. How about a part 2, how to handle .env files (or an alternative) with secrets and keys properly?
This is a great idea!
I actually like this, I'm not going to lie. I'm sold
simple and to the point, thank you :)
I'm glad you liked it! Thank you for the feedback!
Great video as always! Keep going ❤
I've been using since 2017+- a bare repo setup very similar what stow does, but totally manually managed
Stow is definitely useful and way better than manually linking, but for dotfiles, thoughtbot/rcm is THE way to go: easy way to make a real .dotfile a symlink with 1 “mkrc” command (so no need copy first before you call stow), or the other ay around. It has its own rc file to remember what to include and exclude, and other nice features, like support for tags for some or all dotfiles if you differentiate work and home, Mac and Linux setup etc.
2:48 FYI: You don't need to capitalize the "Y". You don't even need to type anything, just press enter. It being capitalized in the text just means that it's the default.
Not knowing Stow existed, I've been using my own script that does the same thing and has all the features in this video. Could've saved some time there 🙃
😅 that's exactly what just happened to me, it's too late I'll keep using my scripts
I find this happens often to me as well 😅
Noob friendly but still concise, very nice!
Stow needs more love ❤
Just want to point out that in the 'stow' docs they state that it was originally used with individual packages
"The examples in this manual will use /usr/local/stow as the stow directory, so that individual packages will be, for example, /usr/local/stow/perl and /usr/local/stow/emacs. "
So there will be 'stow' directory, or 'dotfiles' directory and inside of it there will be the replicas of the folder.
I use yadm, it is much more easier because you don't have to worry about creating a separate folder, it uses bare repository but is a complete wrapper on Git.
Just create the file where it is supposed to be and run "yadm add FILE" then "yadm commit -m 'fix: issue with my FILE'" then "yadm push".
It also have things like templating for cases where you want to run some logic based on the OS and other factors.
And to end it all, you can add a bootstrap script that can be run on new systems, useful for when you want to create a reproduceable setup.
I use a bare repo, btw. That way I don't even need symlinks, all I need to do is create a bare repo (which basically means only creating the .git directory), add an alias, do some minor config on the repo, and I'm good to go. Updating my dotfiles is as easy as editing them, then doing "dotfiles add -u && dotfiles commit -m "message" && dotfiles push". Getting them on my other computer is just "dotfiles pull".
that's just chezmoi with extra steps
@@NSOL chezmoi is cool but I would say that's the extra steps, no need for an extra tool when git already does everything I need with minimal setup.
I simply created a shell script that created symlinks for each of my dotfiles. Stow will make it much easier and prevent me from having to add each new dotfile to the script
Thank you for the inspiration.
I've been using a tool called Chezmoi for the last year or so and absolutely love it; Stow is fine but it's still too manual for my liking
I'm going to check out Chezmoi now!
Yeah, also love Chezmoi. I would recommend it!
Extremely useful, thanks a lot
great one. Thanks for sharing
I need your terminal config!! Fonts, theme, EVERYTHING!
I think he uses "Catppuccin" as theme and "JetbrainsMono Nerd Font" as the font
Thanks@@Milotiiic
Is there a change we could get an overview of your terminal and desktop/wm setup? It looks so nice and functional
I wish I could like this video twice.