TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How do you sync your computer’s development configurations/environment?

105 pointsby baalimagoalmost 3 years ago
I have two personal computers and one work laptop, all of which have similar development environment but not the same. One personal computer runs windows, the other two Ubuntu.<p>Since I knew that I will be using different IDEs and environments, I decided to learn vim and use vim bindings in all my IDEs to ensure some sort of similarity across all my development environments, but it doesn&#x27;t cover it all. I&#x27;ve also tried manually migrating my home directory between different computers, but that comes with several issues, primarily that I&#x27;d have to try to share it between professional and personal computers. So what I&#x27;m left with is basically remembering what I&#x27;m using, and then tediously spend a day or more re-configuring newly installed computers with the software and configurations I know I&#x27;m using. It feels like I have to throw away my perfectly configured hammer which I know by heart and get a new one every time I work at a different workplace instead of bringing it along and perfecting it further. Surely there&#x27;s a better way.<p>How do you keep your development environments&#x2F;ways of working synced and backed up?

82 comments

Aprechealmost 3 years ago
Not just with development environments, but all computer configuration, I stick with the defaults as much as possible. Instead of changing the configuration of the computer, I change myself.<p>For example, let&#x27;s say an app has a default keyboard shortcut I don&#x27;t like. I won&#x27;t change it. Instead, I&#x27;ll just get used to it until it becomes muscle memory.<p>Now the default configurations are my preferred configurations. Of course, there are still a few things I change from the defaults. But since there are so few I can just configure them by hand, because how often am I setting up a new computer? Not very often. And there are so few config changes, it only takes a minute.<p>The only thing I have to actually sync is my vim config. It&#x27;s a very small config, but it&#x27;s still more than nothing. I just store it in a Git repository.
评论 #31520692 未加载
评论 #31518795 未加载
评论 #31518188 未加载
评论 #31519720 未加载
评论 #31542587 未加载
评论 #31521118 未加载
评论 #31519884 未加载
评论 #31518209 未加载
评论 #31520458 未加载
评论 #31521606 未加载
评论 #31521408 未加载
评论 #31519619 未加载
评论 #31520335 未加载
bloopernovaalmost 3 years ago
Basically I use git for .local&#x2F;dotfiles&#x2F; which are then symlinked to the relevant files like .zshrc or .emacs.d&#x2F;init.el. Then I just keep that repo up to date with git pulls. Works across 2 macbooks, a Fedora workstation, and a Fedora headless server.<p>Couple of bits from a guide I wrote recently: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;aclarknexient&#x2F;0ffcb98aa262c585c49d4b3f3ae24019" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;aclarknexient&#x2F;0ffcb98aa262c585c49d4b...</a><p><pre><code> # store stuff here that you don&#x27;t want in github [[ -f $HOME&#x2F;.zshenv-local ]] &amp;&amp; source $HOME&#x2F;.zshenv-local # depends on &#x27;brew install grep&#x27; [[ $OSTYPE =~ ^darwin.* ]] &amp;&amp; alias grep=&#x27;ggrep --colour=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}&#x27; </code></pre> That OSTYPE is great for all those little bits that are unique to each operating system. The zshenv-local is in .gitignore, so you can keep tokens, api keys, etc etc in there. OSTYPE could even be used to import specific files like .zshenv-darwin or .zshenv-linux-gnu<p>If you&#x27;re ssh&#x27;ing between your hosts, you can use something like this:<p><pre><code> if [[ -n $SSH_CONNECTION ]]; then ZSH_THEME=&quot;afowler&quot; else ZSH_THEME=&quot;powerlevel10k&#x2F;powerlevel10k&quot; fi </code></pre> It&#x27;s not fancy and doesn&#x27;t use cool tools, but my setup works for me just fine.
评论 #31518292 未加载
评论 #31523470 未加载
评论 #31519766 未加载
评论 #31518332 未加载
halostatuealmost 3 years ago
I use chezmoi (<a href="http:&#x2F;&#x2F;chezmoi.io" rel="nofollow">http:&#x2F;&#x2F;chezmoi.io</a>) after years of rolling my own. It’s not as straightforward as some home managers, but the extra power it provides is _amazing_ and worth the learning curve.<p>I pull some information from the local keychain and others from 1Password (with `op`; I will be moving most of the rest to 1Password from the keychain). It can run additional scripts _after_ each update (I use it to update my fish plug-in installations if I change `fish_plugins`).<p>It has integrations with many different password managers so that it is possible truly keep your secrets out of your dotfile configuration and _still_ vary the configuration based on those secrets.
评论 #31520159 未加载
评论 #31518916 未加载
评论 #31520045 未加载
alexghralmost 3 years ago
I use Nix to manage: - a desktop running NixOS (primary work machine) - a Macbook (secondary&#x2F;travel work machine) - a Linux VM on WSL - two servers (a raspberrypi in my closet and a Hetzner vps)<p>I keep my config on Github (latest branch <a href="https:&#x2F;&#x2F;github.com&#x2F;alexghr&#x2F;nix&#x2F;tree&#x2F;host&#x2F;vader" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;alexghr&#x2F;nix&#x2F;tree&#x2F;host&#x2F;vader</a>). I&#x27;m still new to this so a lot of my config is duplicated across different hosts but I want to refactor it to eliminate duplication.<p>If you haven&#x27;t yet, I&#x27;d recommend giving Nix&#x2F;NixOS a try. There&#x27;s a bit of a learning curve but it&#x27;s very powerful.
评论 #31519728 未加载
评论 #31521344 未加载
评论 #31520454 未加载
评论 #31519932 未加载
mattlondonalmost 3 years ago
Just use vscode and remotes. Zero hassle and zero friction - just fire up and start coding. It is seamless.<p>I use it on windows, Debian, macos and even Chromebooks and don&#x27;t have to worry about any kind of syncing. It just works<p>It has a built in settings sync thing, but as a general rule I strongly strongly avoid the use custom settings (in anything) to avoid the issue you are facing. There is in my experience a huge productivity gain to be had by just being pragmatic and using (and knowing) defaults in everything you use frequently, and not being a useless prima dona if your custom key bindings are missing from every single machine you need to use each day&#x2F;week&#x2F;month&#x2F;year. We jump around servers and computers frequently, so I find it is easiest and most productive to just go with the flow and use the defaults so I can be working immediately as soon as I SSH into a new host or am given a new laptop to use for a 3 week long contract or whatever.
davegaueralmost 3 years ago
Yeah, mixed environments are really tough. Though (most) of my machines are Linux, they often have _some_ stuff that should be the same and _some_ stuff that should not. My solution has been to use the fine-grained GNU Stow approach, which allows me to apply only the bits I need for a particular machine.<p>The files you&#x27;re managing don&#x27;t even need to be text, though, of course, it makes versioning, etc. a lot easier.<p>I also check the host name in some of the scripts to modify behavior depending on the machine.<p>I did a write-up about my whole setup (emphasis on GNU Stow + Git) here:<p><a href="https:&#x2F;&#x2F;ratfactor.com&#x2F;setup2" rel="nofollow">https:&#x2F;&#x2F;ratfactor.com&#x2F;setup2</a>
评论 #31517931 未加载
ryangibbalmost 3 years ago
I used to use a git repo of dotfiles which used a script to symlink into $HOME: <a href="https:&#x2F;&#x2F;github.com&#x2F;RyanGibb&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;RyanGibb&#x2F;dotfiles</a><p>But there were a few problems with it: - installed packages needed to be managed separately (the mechanisms for which varied by platform) - managing differing configs for different machines (e.g. headless servers, hardware quirks) was done by managing different branches of this repo and rebasing, which was a pain - it was generally brittle and hard to change<p>I&#x27;ve started to use <a href="https:&#x2F;&#x2F;nixos.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;nixos.org&#x2F;</a> and it&#x27;s been like night and day: <a href="https:&#x2F;&#x2F;github.com&#x2F;RyanGibb&#x2F;nixos&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;RyanGibb&#x2F;nixos&#x2F;</a><p>My config is version controlled, reproducible, manages packages, and is very composable.<p>Using the nix package manager and <a href="https:&#x2F;&#x2F;github.com&#x2F;nix-community&#x2F;home-manager" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nix-community&#x2F;home-manager</a> this should work on other Linux distributions, MacOS, and even Windows Subsystem for Linux. Although I haven&#x27;t tried this for myself yet.
sethdalmost 3 years ago
Like a few others here, I use git with a .dotfiles directory, which uses an install script that creates symblinks (among other things). It&#x27;s grown a lot of over the years (maybe decade now?) and I&#x27;ve been meaning to look into using something like GNU Stow, but haven&#x27;t got around to it.<p>The install script and configuration works on macOS and Linux, but sometimes requires updating when running on a new machine (like recently when provisioning a new M1 Max MacBook Pro). At one point I had it installing default packages (particularly a lot of stuff from Homebrew), but ultimately moved away from that because I realized it just kept too much old unused cruft hanging around.<p>I also have my configuration files setup so that it can be used for work or personal machine. For example, my .gitconfig includes another config when in the ~&#x2F;work directory:<p><pre><code> [includeIf &quot;gitdir:~&#x2F;work&#x2F;&quot;] # work-specific settings (override email, etc.) path = ~&#x2F;work&#x2F;.gitconfig.inc </code></pre> <a href="https:&#x2F;&#x2F;github.com&#x2F;sethdeckard&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sethdeckard&#x2F;dotfiles</a>
评论 #31518554 未加载
kreetxalmost 3 years ago
You say you also have a windows machine, but if you were to use only linux then I would seriously consider using nixos. I have three desktops and one macbook pro (2015) all of which run off of the same configuration.nix and the home-manager nix package. Using this on a new machine I&#x27;m up and running in about an hour.<p>Configuration changes are committed and pushed, and whenever changing machines a `git pull &amp;&amp; nixos-rebuild switch` would bring the current one up to date.<p>Things that are automated: installed packages, systemd services, mounts, users and user groups, networking (including VPNs, &#x2F;etc&#x2F;hosts), users&#x27; environments, users&#x27; home folder content (dot files, random useful bash scripts put in PATH, etc), emacs packages.<p>A few manual steps still remain (adding keys, cloning repos, some desktop environment tweaks) - undone mostly out of laziness to figure them out.<p>Of course, one has to learn nixos to use this, and that, quite frankly, has been quite pain :). Though, once you get a hang of it, it relieves a huge painpoint: you are no longer mentally attached to any single physical computer.<p>Would recommend.
sunsunsunsunalmost 3 years ago
I use primarily linux but these are the tools i use:<p>Ansible - I can bootstrap a new linux install with all of my configs in ~10min, this has saved me countless hours of time. My linux installs are heavily modified (tiling window manager, lots of custom hotkeys, custom ricing)<p>Git - I sync all of my dotfiles to git and and can keep them in sync between PCs.<p>Syncthing - My dev folder and a few other important folders are kept in sync between all of my PCs using syncthing. I can save a file on my desktop and turn to my laptop and the file will almost instantly be there.
zackmorrisalmost 3 years ago
I record everything that I do, for initial setup or otherwise, in a large text file and&#x2F;or cloud document holding blocks of shell instructions like:<p><pre><code> # set up stuff ( VAR=&lt;stuff&gt; curl &lt;stuff&gt; &lt;do-something-with&gt; &quot;$VAR&quot; brew install &lt;stuff&gt; # or apt-get install &lt;stuff&gt; # ... ) </code></pre> I write them so I can paste them into the shell at any time and keep my environment updated declaratively, without having to think. This way I never store any local state, not even command aliases. Otherwise I start getting attached to my setup, which leads to anxiety.<p>It&#x27;s good practice to check out a project repo periodically and see what it takes to get running inside a fresh OS or user. It&#x27;s handy to do while onboarding new developers too. Sometimes I&#x27;ll even put these setup instructions at the top of the project repo&#x27;s readme itself, so it doesn&#x27;t have a dependency on anything external.
trip-it-upalmost 3 years ago
I have a remote Linux server for my dev environment. This way it&#x27;s one dev environment that I can access from any device.<p>I am mostly using NeoVim now but in the past VSCode with the remote extension worked great too. It&#x27;s totally platform agnostic (I can even work straight from my iPad). It&#x27;s also a single instance that I have to manage instead of syncing or making changes in more than one place.<p>With this setup I can still use docker containers or VM&#x27;s to make it easy to spin up different types of dev environments but it&#x27;s all on one computer so super easy to manage. Since I don&#x27;t have to worry about managing multiple platforms I create simple bash scripts to install everything and create the necessary configs so if I need to wipe everything and start over it&#x27;s no big deal.
yjftsjthsd-halmost 3 years ago
Dotfiles in my home directory go in a repo that gets cloned and &quot;installed&quot; (I use a shell script that I wrote to make all the symlinks, but GNU Stow is probably better better). System level configuration and package installation is handled by ansible, with a certain amount of stuff controlled by conditional statements based on the distro and host name of the machine to allow arbitrarily local overrides.<p>All that said, if I was starting today I would strongly consider just putting everything into nix with home manager and carry that config around in a git repo that installed my packages and their configuration and encapsulated my entire environment.
评论 #31518329 未加载
boukalmost 3 years ago
I use Nix: <a href="https:&#x2F;&#x2F;bou.ke&#x2F;blog&#x2F;nix&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bou.ke&#x2F;blog&#x2F;nix&#x2F;</a><p>I&#x27;m able to have the same shell with all my Vim plugins across macOS and Linux with changes committed to git. It&#x27;s been so good, setting up all my command-line tooling now takes about 15 minutes from scratch.
评论 #31523192 未加载
buro9almost 3 years ago
I travel light.<p>I have multiple machines on multiple operating systems and dev on all of them. I sync nothing across them, instead I adjust to as many of the defaults of Sublime Text as possible and the only consistency is in how I organise the working directory on disk.<p>This isn&#x27;t what you asked, but I&#x27;m not sure one has to sync them all.
whimsicalismalmost 3 years ago
I just have a dotfiles repository and in it an installation script, one for Mac and one for Linux.<p>Might be bad of me, but I definitely share it between professional and personal - it&#x27;s just dotfiles after all.<p>The biggest difficulty is making sure that the installation script actually matches what you want to happen because it is difficult to test on already finished system. so every so often I spin up a Digitalocean droplet and try to configure my system from scratch using the dotfiles.
评论 #31517916 未加载
eternityforestalmost 3 years ago
That&#x27;s one reason I have close to zero interest in Vim(Or window managers, or anything of the sort).<p>I can rebuild my configuration(Aside from some fussy embedded toolchains) in half an hour or so. VS code, a few different linters, swissknife, stack tabs, timestamper, indenticator, pylance.... done.<p>Even if there&#x27;s a Windows machine I&#x27;m fine. Haven&#x27;t done anything on mac in a decade but I assume I&#x27;d be fine there too.<p>Also, if something takes more than 5 minutes to learn or set up I will usually at least look for other options, on the assumption that if it takes time to set up, it will probably take time to maintain and modify, because it was probably made by people who enjoy deep customization.<p>There&#x27;s lots of things worth learning and setting up, but also lots that... I&#x27;m not so sure about.
评论 #31519411 未加载
khaledhalmost 3 years ago
Sounds like a good opportunity for building a tool that syncs dotfiles in a smart way across different environments. Bonus points for managing what gets synced at a granular level, i.e. including&#x2F;excluding certain files&#x2F;configurations.
Sphaxalmost 3 years ago
I&#x27;ve been using Ansible for years now to do this.<p>Right now all my computers run fedora so there&#x27;s not much difference between them but for some time I used Ansible on macOS too. It worked but was a pain to make my roles compatible for both linux and macOS.<p>In my experience Ansible is good when dealing with text files or if there&#x27;s already a module for what you&#x27;re trying to do (for example managing postgresql users). If what you&#x27;re trying to do is complex enough that you need to write a custom module or plugin, it is a pain in the ass: we had to do that at work and it was terrible.<p>Ansible works on Windows but I have no experience with it.
评论 #31518246 未加载
deep_originsalmost 3 years ago
Check out Unison [0]. I use it to sync between macOS and Linux box.<p>[0] <a href="https:&#x2F;&#x2F;www.cis.upenn.edu&#x2F;~bcpierce&#x2F;unison&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.cis.upenn.edu&#x2F;~bcpierce&#x2F;unison&#x2F;</a>
geerlingguyalmost 3 years ago
I symlink a few files in place via Dropbox, but have most of my local configs in a dot files repo: <a href="https:&#x2F;&#x2F;github.com&#x2F;geerlingguy&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;geerlingguy&#x2F;dotfiles</a><p>Then for more systemwide configuration, I have an Ansible playbook I run every now and then (configures apps, dock item order, etc): <a href="https:&#x2F;&#x2F;github.com&#x2F;geerlingguy&#x2F;mac-dev-playbook" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;geerlingguy&#x2F;mac-dev-playbook</a>
diffeomorphismalmost 3 years ago
A nice way to do that with git:<p><a href="https:&#x2F;&#x2F;news.opensuse.org&#x2F;2020&#x2F;03&#x2F;27&#x2F;Manage-dotfiles-with-Git&#x2F;" rel="nofollow">https:&#x2F;&#x2F;news.opensuse.org&#x2F;2020&#x2F;03&#x2F;27&#x2F;Manage-dotfiles-with-Gi...</a><p>&gt; then tediously spend a day or more re-configuring newly installed computers with the software and configurations I know I&#x27;m using<p>Config is just dotfiles pull and software is either a bash script, dpkg --set-selections or ansible (a bit overkill).<p>Another option is dropbox and lots of symlinks.
Joerialmost 3 years ago
I use syncthing to sync my dev folders between windows, linux and mac. The mac is set up to backup to time machine and backblaze. I’ve standardized on vscode as much as possible, use settings sync to automatically sync its config between machines, and put per-project config in the project’s folders.<p>If I had to start over now I would consider something like github codespaces, but requiring constant internet connectivity would be enough of a downside I would land on syncthing + vscode again.
coroboalmost 3 years ago
It&#x27;s probably awful but I sorta really just rely on system backups for my configs. Download and restore anything I&#x27;m missing from the latest backup when I reinstall the system.<p>I do keep my ~&#x2F;scripts&#x2F; directory in a git repo (also this directory is in my $PATH) because they&#x27;re all very hack and slash &quot;I need to do a thing repeatedly, quickly&quot; scripts. Sometimes I might want to go back a step or two when I really break everything. This repo auto pulls&#x2F;commitpushes every now and then as this one is more useful to be up to date on all machines than to have useful commit messages<p>As for live syncing devices I do have unison running on my laptop frequently to sync (when its on) a few directories I might need offline. Mostly everything I need as a dev is in git repos though, so I use manual git push&#x2F;pulls to sync everything else<p>I did previously use mackup (<a href="https:&#x2F;&#x2F;github.com&#x2F;lra&#x2F;mackup" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lra&#x2F;mackup</a>) to sync configs but if I&#x27;m honest I forgot I had it set up the last time I reinstalled so it got removed from the process unintentionally
kodahalmost 3 years ago
I have a desktop and a laptop, both running the same OS (PopOS).<p>Note: I don&#x27;t sync anything to my work computer. I will never trust adding a conduit for my personal activity or files to my work computer.<p>I use SyncThing which syncs critical parts of my home directory (.config, project files, misc dot files, git configs for multiple profiles). My SyncThing setup is local network only. I work mostly on my desktop and if I&#x27;m about to leave I spin my laptop up real quick, it syncs everything in a few seconds, and I&#x27;m out the door.<p>In terms of projects, this also syncs my project settings from VSCode and IntelliJ. I was a little worried about my apps that support hot code reloading if I left the daemon running by mistake, but honestly I&#x27;ve discovered no local state issues.<p>My shell configuration is also synced, which is really nice. Once homed (in systemd) becomes more of a thing I&#x27;ll probably see how I can incorporate that workflow.
agentwigglesalmost 3 years ago
I really like homeshick, it&#x27;s very simple and stays out of my way, but also makes it trivial to keep track of aliases and config that I like to have around.<p>I don&#x27;t do a ton of configuration these days, I mostly just set up VSCode, fzf and my .vimrc and feel pretty happy. But whenever I do want to make a change, I know it&#x27;s worth the effort, since it can be easily synced to any of my machines.<p>I do have a setup where my bashrc and zshrc just source a common aliases &#x2F; functions file, which makes most of my config work across both shells. If I&#x27;m doing something tricky then I&#x27;ll usually take the time to implement it for both shells.<p>I also have a file called `.system-specific-profile` which is sourced by my common profile, but is not synced - this is where I dump one-off stuff that doesn&#x27;t need to be synced.<p>All in all it&#x27;s fairly minimal but flexible enough for basically anything I&#x27;ve ever needed to do.
cssalmost 3 years ago
- Dotfile repo hoested on GitHub<p>- `git clone` said repository to my machines<p>- `ln` from repository folder to `~&#x2F;` (can be done in an install script or piecemeal)<p>- `git pull` to update<p>I also purposely try and use as many default configurations as possible. I use a lot of remote machines that do not have my configs on them, so I do not want to become too reliant on custom setups.
kaylynbalmost 3 years ago
Ansible. I maintain 4 workstations (3 Linux, 1 Windows) from the same config. It&#x27;s a bit overkill but it has the flexibility to deal with the hardware and OS differences.<p>Linux is essentially automatic. Install OS using custom arch-iso build. Download Ansible config repo. Run playbook.<p>Windows is a bit more rough. Ansible runs in WSL connecting to the host via ssh.<p>For work I just fork my personal config, add changes needed for work environment in a private repo. I can pull upstream changes and rebase easily.<p>Main downside is it&#x27;s a bit verbose, and I still need manual steps to converge certain types of changes (like deleting&#x2F;moving configs) because I don&#x27;t want to write even more code to do that.<p>Having all the additional steps in a role and not just config files is extremely useful when revisiting a configuration years later.<p>For development, I usually just use Git to synchronize changes. Syncthing is useful sometimes.
Daegalusalmost 3 years ago
I use a combination of a .dotfiles folder and syncthing.<p>my .dotfiles folder has a script in it that symlinks the dotfiles and folders out to the right places, then installs any tools with asdf and the .tool-versions I save. usually gets any Linux setup up and running in a few seconds.<p>I then have a workspace folder that stores all my code and projects. I syncthing that between my computer and a 3rd server computer as a backup that has weekly backups running. the 3 way sync makes it easy to not lose anything, or if one machine goes down when I need my most recent files.<p>Since I use WSL on Windows, the same stuff works mostly the same. The script I have is tailored to my preferred distros. I have currently a fedora one, but I also have an Ubuntu and a Arch one for when I used those or need to get my stuff setup on them. I try to keep all of them updated. asdf really helps with tools.
kkfxalmost 3 years ago
Personally I&#x27;m in Emacs for almost anything so different environments are just different set of org-mode files with things to tangle, different org attach and roam directories etc, common staff sync-ed with unison.<p>That&#x27;s work VERY well, but might not fit your needs depending on what you need to use for work...
bloopernovaalmost 3 years ago
EDIT: Chezmoi will do all this. <a href="https:&#x2F;&#x2F;www.chezmoi.io&#x2F;quick-start&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.chezmoi.io&#x2F;quick-start&#x2F;</a><p>Somewhat related question:<p>Can GNU stow do this, and if not, can anyone recommend a package&#x2F;app to do it? I want to have a config file with a list of source files and where I want them symlinked. Then have a tool that maintains those links. Example:<p><pre><code> # SOURCE # DESTINATION zsh&#x2F;zshenv ~&#x2F;.zshenv zsh&#x2F;zshrc ~&#x2F;.zshrc gitconfig ~&#x2F;.gitconfig </code></pre> From my reading of GNU stow, it operates on full directories and relies on having the files already named correctly.
评论 #31519540 未加载
dawnerdalmost 3 years ago
I just have a bare metal server I rent from OVH and run everything there and just remote into it with VS codes pretty great remote feature. Works great unless I&#x27;m traveling. If I&#x27;m going to be on the road I&#x27;ll just setup what I need locally just in case.
ajbalmost 3 years ago
I keep my Dev environments in dockerfiles. It&#x27;s a bit annoying as docker isn&#x27;t designed for this so I had to figure out how to punch holes in its security for things like access to USB, running graphical apps, etc. I tried to watch to podman but ironically didn&#x27;t get that to work because it is too secure.<p>The advantage of all this is that they are separate so you don&#x27;t need to worry about some embedded IDE or python crap barfing all over your system. I check all the dockerfiles and config files that they install into git. I&#x27;ve been watching nix but it&#x27;s seems like it&#x27;s a bit of a Marmite project so I might wait to see if something better turns up.
e4e5almost 3 years ago
home-manager and nix: <a href="https:&#x2F;&#x2F;github.com&#x2F;legendofmiracles&#x2F;dotnix" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;legendofmiracles&#x2F;dotnix</a><p>This allows me to abstract logic easily, have it all modular and have everything be nix.
crispgmalmost 3 years ago
I have a dotfiles repo on GitHub, with Homebrew bundle to install almost everything and some additional shell script. For real dotfiles, I just migrated to rcm to manage that easier.<p>There are lots of dotfiles repos on GitHub. And you learn that quickly.
lb4ralmost 3 years ago
You could use a dotfiles manager like <a href="https:&#x2F;&#x2F;yadm.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;yadm.io&#x2F;</a><p>It&#x27;s more or less a wrapper of git, but it comes with a bunch of features that allow you to do the things you describe.
评论 #31518531 未加载
synicalxalmost 3 years ago
I just have my dotfiles in git, along with a script that clones the repo, moves the files into position, installs packages and does a few other little things. I had thought about just making my whole ~&#x2F; a git repo but I feel like that would inevitably lead to me putting something into git that I didn&#x27;t want to be in there like a private key or something (I&#x27;m not that bright, it&#x27;s bound to happen).<p>Another option I considered was Ansible or similar, but my script was very simple to write and has no dependencies other than bash and git which I do kind of like from a simplicity perspective.
jezalmost 3 years ago
I use a tool called rcm[0], which is essentially a set of shell scripts for managing symlinks from $HOME into $HOME&#x2F;.dotfiles. $HOME&#x2F;.dotfiles can then be a git repo.<p>Some notes:<p>1. rcm lets you decide make host-specific or host-agnostic dotfiles. For example, I can declare that I want a different `.ssh&#x2F;config` file for each host, and rcm will figure out which `.ssh&#x2F;config` to symlink based on the current machine&#x27;s hostname.<p>2. The installation process is very simple. It&#x27;s just shell scripts, so you don&#x27;t have to worry about a C&#x2F;C++ compiler or having any pre-reqs installed. Operating system packages exist for the common platforms, and there&#x27;s also a convenient way to &quot;build&quot; from source using configure &amp;&amp; make &amp;&amp; make install. The from source option is particularly convenient if you need to change the installation prefix to a user-writable location on a multi-user machine.<p>3. I use SSH Agent Forwarding[1] to avoid needing to install private keys (either new keys or copies of existing keys) on all the hosts I manage. This lets me git push and pull to my dotfiles repo on all hosts.<p>4. Taking it a step further, some shell config I have is host-specific (e.g., certain PATH modifications I only want to apply on certain hosts). Rather than use the host-specific dotfile feature of rcm for the whole .bashrc, I factor my shell config files into multiple files, that I then source. One of these files is called `$HOME&#x2F;.util&#x2F;host.sh`, which is host specific. Again, rcm creates a symlink from this to the correct host-specific file automatically by hostname.<p>If you&#x27;re curious to learn more about any of this, my dotfiles are public.[2]<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;thoughtbot&#x2F;rcm" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;thoughtbot&#x2F;rcm</a><p>[1] <a href="https:&#x2F;&#x2F;docs.github.com&#x2F;en&#x2F;developers&#x2F;overview&#x2F;using-ssh-agent-forwarding" rel="nofollow">https:&#x2F;&#x2F;docs.github.com&#x2F;en&#x2F;developers&#x2F;overview&#x2F;using-ssh-age...</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;jez&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jez&#x2F;dotfiles</a>
nkantaralmost 3 years ago
My use case is simpler than yours, as I only have one personal and one work Mac, so I can get away with a manually managed dotfiles repo[0]. My work GitHub account is a collaborator on the repo so I can edit config on both machines. The actual differences in configuration are intentionally minimal and kept in separate, unversioned, optional files. This repo is the only thing shared between my personal and work machines<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;nkantar&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nkantar&#x2F;dotfiles</a>
mihaicalmost 3 years ago
I&#x27;ve got a fairly unique setup, and work on a Windows machine that runs my Ubuntu VM with KDE(where I do all development).<p>I take monthly snapshots of the VM, and carry it around on all my computers. It drifts from time to time, and I just end up just overwriting it with an older version when I fumble with some settings. Once every 3-4 years I do a clean reinstall of the VM.<p>I tweak a bit frequently used software like PyCharm, but aim to keep everything in stock and updated constantly.<p>I&#x27;ve not had any issues or regrets in the last 5 years and I&#x27;ll carry this on indefinitely.
评论 #31521167 未加载
jordanmorgan10almost 3 years ago
This might be the worst answer but....<p>I dont! I love setting up each new machine fresh, because I feel like during the development cycle I incur a lot of software&#x2F;CLI tooling debt that I don&#x27;t need anymore.
评论 #31554784 未加载
theshrike79almost 3 years ago
Homeshick for dotfiles: <a href="https:&#x2F;&#x2F;github.com&#x2F;andsens&#x2F;homeshick" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;andsens&#x2F;homeshick</a><p>Docker for Obsidian and Alfred syncing - the three target limit on the free tier is just barely enough for 2 of my own computers and my work laptop.<p>I&#x27;ve also got a Brewfile for installing the basic tooling on macOS<p>I also have a &quot;how to set up a new computer&#x2F;server&quot; document on Notion that I use so I don&#x27;t forget any steps.
maxpetrettaalmost 3 years ago
I&#x27;ll echo the other comments recommending to stick with &quot;defaults&quot;. However, I do like having the ability to sync my installed packages and apps across machines, so I wrote a little script to update&#x2F;reinstall packages on macOS using brew: <a href="https:&#x2F;&#x2F;github.com&#x2F;maxpetretta&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;maxpetretta&#x2F;dotfiles</a><p>Between my dotfiles and cloud storage, you could throw my laptop in a lake and I could configure a brand new machine in an hour or two.
kcartlidgealmost 3 years ago
I switch between MacOS, Window 10, and Linux Mint.<p>In each case I stick with the defaults except for minor tweaks, where I keep a Markdown bullet list - things like switching on hidden files and file extension visibility, or installing obscure things like Rectangle and Silicon Info on the Mac, or where to get my favourite fonts from (eg iA Writer Duospace). None of that is time-consuming enough to script or otherwise automate.<p>No need to sync anything, but to be fair I habitually reinstall the OS at least once a quarter so I&#x27;m pretty practiced at it.
mmphosisalmost 3 years ago
With the exception of Excel, I don&#x27;t use Microsoft for development. I don&#x27;t use vim. I stick with the defaults as much as possible as painful as that is. I thoroughly document all changes I make so that on the next clean install, I can remember what I did before. Any of my &quot;conveniences&quot; are never dependencies. The only dotfile that matters to me is my .bash_aliases file which is merely a stub pointing to an over-engineered startup script to avoid the madness of using dotfiles.
rsstackalmost 3 years ago
It isn&#x27;t what you asked, but we use Gitpod to have identical environments across our team and between different laptops. I used to avoid writing code on my Macbook (using it only for administrative stuff I can do in Chrome), but now that it&#x27;s identical to my main Ubuntu driver it&#x27;s actually pretty nice. I also used to hate Windows&#x2F;Mac developers complaining that scripts don&#x27;t work for them because bash&#x2F;coreutils are different on their machines.
mikewhyalmost 3 years ago
Work-provided bootstrap script to install most tools.<p>Self-provided dotfiles for shell and the like.<p>But since I started using VS Code Remote, the &quot;bootstrap&quot; portion doesn&#x27;t happen all too often.
solidninjaalmost 3 years ago
I use salt for configuration management of the machine itself (system-wide settings, packages), a dotfiles git repo for desktop configuration files with submodules for certain things (like package managers for vim and zsh).<p>For development environments, JetBrains IDEs have their own cloud config sync thing and I try to stick to defaults as much as possible (and rely on the language environment&#x27;s tooling for linting&#x2F;formatting&#x2F;etc rather than the one in the IDE).
JamesSwiftalmost 3 years ago
Nix package manager &#x2F; Home manager + a Brewfile for some casks<p>Now that there are flakes (and the macOS installer is really good now), I can `git clone` my config and bootstrap a new machine with this<p><pre><code> sh &lt;(curl -L https:&#x2F;&#x2F;nixos.org&#x2F;nix&#x2F;install) --daemon nix build .#homeConfigurations.{computer}.activationPackage --max-jobs auto --cores $(sysctl -n hw.ncpu) &amp;&amp; .&#x2F;result&#x2F;activate &amp;&amp; rm -rf .&#x2F;result</code></pre>
sexy_pandaalmost 3 years ago
I stick to default configuration as far as possible and I&#x27;d rather learn the hot key I dislike, rather than changing it.<p>Everything is a in git repository I usually call dotfiles.
kesslernalmost 3 years ago
I wrote a utility for this problem. I had 3 computers -- Linux with HiDPI, Linux with a normal DPI, and Mac. They all used the same dotfiles with slight differences. It was impossible to keep them in sync. I created a super simple template utility designed for working with dotfiles.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;kesslern&#x2F;dot-templater" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kesslern&#x2F;dot-templater</a>
_h9mbalmost 3 years ago
Basically I use Git, ln and a setup script that I wrote.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;danisztls&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;danisztls&#x2F;dotfiles</a><p>&gt; primarily that I&#x27;d have to try to share it between professional and personal computers<p>My script has a recipes feature so you can store config at arbitrary places and have different recipes&#x2F;configs for different situations.
neurostimulantalmost 3 years ago
These days I use VSCode&#x27;s remote development extension to mount my dev machine on my laptop. It works well for frontend and backend works (automatic port forwarding), but obviously doesn&#x27;t work when working on native or mobile apps. I simply duplicated the environments and sync the development files with git when working on native stuff.
temp8964almost 3 years ago
Wouldn&#x27;t remote be the simplest solution?<p>Unfortunately, I can&#x27;t find a perfect remote software, which should be able to automatically adapt to client resolutions, support multiple monitors, use hardware acceleration.<p>RDP is great, but it does not utilize the high bandwidth of modern network environment, so it&#x27;s not as performant as it should be.
nishparadoxalmost 3 years ago
I have a custom repo which my .config folder will have symlinks to. It gets synced to remote git (~GITHUB). For new devices, I use stow[0] to create symlinks...<p>[0] - <a href="http:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;stow&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;stow&#x2F;</a>
lachenmayeralmost 3 years ago
As many others have mentioned, dotfiles in a git repo (<a href="https:&#x2F;&#x2F;github.com&#x2F;lachenmayer&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lachenmayer&#x2F;dotfiles</a>), mainly for having unified shell themes&#x2F;aliases&#x2F;etc. on all machines I use.
ilconsiglierealmost 3 years ago
I stole&#x2F;copied my setup from Nick Janetakis who&#x27;s just great all around. Its worked for me through several new systems and many updates.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;nickjj&#x2F;dotfiles" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nickjj&#x2F;dotfiles</a>
thisisbriansalmost 3 years ago
I use Strap (<a href="https:&#x2F;&#x2F;github.com&#x2F;MikeMcQuaid&#x2F;strap" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;MikeMcQuaid&#x2F;strap</a>) to manage everything and it works pretty dang well for me on macOS. Homebrew brewfiles were a game-changer.
nelgaardalmost 3 years ago
I have a repository with common config files. Whenever possible I prefer to not just symlink files but instead include them (source in shell, load-file in emacs, etc). That way I can still have local variations, work-related stuff, etc.
realPubkeyalmost 3 years ago
I have put vscode into a docker container. This allows you to commit the settings via git.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;pubkey&#x2F;vscode-in-docker" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pubkey&#x2F;vscode-in-docker</a>
jedbergalmost 3 years ago
Syncthing is magic. I use it on all my computers (personal&#x2F;work&#x2F;home server&#x2F;etc).<p>Put the config files in their own directory and then share them with syncthing and then use symlinks to link to them in the right place on each system.
mixedCasealmost 3 years ago
Nix&#x2F;NixOS. It is the best in class tool for this purpose, with a bumpy learning curve due to the subpar language and complex documentation. But once things get going it&#x27;s quite a convenience.
frizlabalmost 3 years ago
I have a dedicated repo for this: <a href="https:&#x2F;&#x2F;github.com&#x2F;Frizlab&#x2F;frizlabs-conf" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Frizlab&#x2F;frizlabs-conf</a>
stickyrickyalmost 3 years ago
I don&#x27;t synchronize them. I have Ubuntu server edition running on an old machine. I ssh into the machine to do any sort of programming. VSCode Remote is really helpful.
markstosalmost 3 years ago
Two parts:<p><pre><code> 1. For dotfiles, YADM: https:&#x2F;&#x2F;yadm.io&#x2F; 2. For everything else, like packages to install, I use an Ansible playbook. </code></pre> Both sync via git.
SparkyMcUnicornalmost 3 years ago
For the MacOS users out there, Mackup is pretty nice.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;lra&#x2F;mackup" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lra&#x2F;mackup</a>
moguialmost 3 years ago
I just use this <a href="https:&#x2F;&#x2F;github.com&#x2F;lra&#x2F;mackup" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lra&#x2F;mackup</a> since a decade
kbdalmost 3 years ago
Everything is source-controlled: <a href="https:&#x2F;&#x2F;github.com&#x2F;kbd&#x2F;setup" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kbd&#x2F;setup</a>
eez0almost 3 years ago
the main question here is, do you really need to change the settings once you have a baseline?<p>I&#x27;m another one using a private GitHub repo for this. But I don&#x27;t need to pull, update, sync or whatsoever. I&#x27;ve been using the same config for years, and in the eventual case that I would change &#x2F; add something, I can do that quickly in a few computers, no need to have any sort of sync.<p>For VSCode settings I just use the built-in service.
snarfyalmost 3 years ago
This is pretty much what vagrant was made for.<p>[1] - <a href="https:&#x2F;&#x2F;www.vagrantup.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.vagrantup.com&#x2F;</a>
digikataalmost 3 years ago
I use git to sync a local bin folder between machines. One branch per type environment though sometimes that&#x27;s just a branch for a particular machine.<p>common files between many environments are just in a common subdirectory. This could be a submodule, but that&#x27;s overkill, I just sync it via a git path checkout from time to time.<p>Dotfiles are in there too and symlinked to wherever they&#x27;re used. Similar with other configs. If they&#x27;re picky about being symlinked, I&#x27;ll write a quick copy script to pull them into a subfolder to bring it into git.
macinjoshalmost 3 years ago
I&#x27;ve moved my neovim dev environment entirely to a docker container. That way my development environment is always only a `docker run` away.
rcarmoalmost 3 years ago
I use SyncThing between Mac, Windows (including Ubuntu WSL) and Fedora. I also sync my dot files (with a Git backup) that way.
D13Fdalmost 3 years ago
I just use Goodsync personally. I used to have it sync to a WebDAV server in my house, but these days I just use a cloud provider.
TT-392almost 3 years ago
I manually scp config files whenever I set up a new pc (I should really set up somethin better)
lamontcgalmost 3 years ago
syncthing and gnu stow.<p>as long as things stay reasonably connected and you take a bit of care to avoid split-brain (after powering up a laptop that has been off or away for awhile give it some time to sync) then you can even sync git repos just fine.
helsinkialmost 3 years ago
I mount the home directory to NFS for all of my machines.
trentthethiefalmost 3 years ago
Set up your environment in a nix shell.
JoaoCostaIFGalmost 3 years ago
I use a git repo with dotbot
oxffalmost 3 years ago
I just use nix.
vinceguidryalmost 3 years ago
Scripting, scripting, and more scripting. I wish there were a better way, but there isn&#x27;t. And it will forever be brittle, because operating systems change. With that said, here&#x27;s what I do.<p>First, I keep a personal monorepo. It not only has all my dotfiles, but also my personal website, and binary tools I&#x27;ve written. A game changer for me was git submodules, which let me keep third party stuff up to date with a minimum of fuss. The only thing I keep in a separate repo is my password repository.<p>So the main script I use invokes a lot of other scripts in order. This is so I can just run one thing to update everything. The first thing it does is sync the monorepo and password repos. Then it runs my homebrew stow command, which is like GNU stow[1] but I have all the control I want over it because I wrote it in Ruby. This not only syncs my dotfiles but also copies all my homebrew bins over to where they&#x27;re not only in $PATH, but &#x2F;usr&#x2F;local&#x2F;bin so that they&#x27;re in root&#x27;s path as well.<p>Next is package management. I run Arch Linux and use pacdef[2] for lightweight declarative package management. If I install some random package, it will remove it at this step, unless I put it in one of my package lists that I keep in the monorepo. This tool will take any Arch Linux install with paru or yay and make it into mostly the system I use every day. It is the most brittle part of the process because, well, operating systems change.<p>Finally, to manage all the <i>other</i> package management tools out there, I use asdf.[3] My script installs all the plugins if they&#x27;re not there, update them, then installs everything. Most asdf plugins support a &#x27;default lib&#x27; config, which install a list of packages whenever you install a version of the tool. It&#x27;s not the wholly declarative solution that pacdef is, but I may eventually write enough scripting to get it there.<p>It has to be this way because Linux is freedom, and with great freedom comes great amounts of time spent learning how it works. I used to try to keep a portable config across OSX, Windows WSL, and Linux, but that was really hard to maintain, and my life got way simpler when I decided no more OSX or Windows. It&#x27;s kinda possible to do but it&#x27;s a ton of work.<p>But the basic building blocks are, 1) dotfiles, 2) system packages, 3) secondary packages. Get those three scripted, and you&#x27;re off to the races.<p>[1] <a href="https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;stow&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;stow&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;steven-omaha&#x2F;pacdef" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;steven-omaha&#x2F;pacdef</a><p>[3] <a href="https:&#x2F;&#x2F;asdf-vm.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;asdf-vm.com&#x2F;</a>
评论 #31520447 未加载
s09dfhksalmost 3 years ago
mackup + syncthing