I have accumulated a fairly complex dotfiles setup (bashrc, emacs/vim config, Dockerfiles, one-off scripts) over the years at work. I wonder what's the best way to port your dotfiles to your next job after removing company specific information (server name, mount point, job specific scripts). Do you start from scratch for each new job, or do you use a github private repo and sync it with work profile? I'm be fine to start a new bashrc from scratch but it would be a pain to come up with emacs/vim config files I have been tweaking for years. My other concern is legal responsibility. My current contract has a clause that basically says any code I wrote, event in my own time and on my own computer (i.e. my personal dotfiles), belongs to my current employer. It is absurd I know but apparently it is common in the US. Based on this along I probably will have to start from scratch. Thoughts?
OP many medium/large companies have there own tooling/scripts so must of your aliases or functions are useless.
Wait, what? The vast majority of the dotfiles I wrote at Amazon have zero Amazon-related aliases or function. The build stuff is already default aliased in the config they themselves provide.
You will never need them. Every company has new problems and you will never find a copy/paste situation
Nonsense.
Or just save it to a USB. You're not that important
1. That contract is unenforceable. Stuff you do in your own time, own machine, is not employer's property. 2. Complicated dotfiles could potentially be covered by copyright, but in the general case, configuration files are supposed to be trivial enough that they're not copyrightable in the first place. Your vim and Emacs config is probably 100% your own property, even when you wrote them on a work machine during work hours, especially if you've never used any significant snippets provided by the workplace. 3. I've seen people sharing their dotfiles publicly with all the server names intact. E.g., for mutt. It makes perfect sense, because once you remove the servers, the config may make no sense. Or simply do a post-edit before publishing to remove the names, or write a script to automatically swap the names based on a separate config file. 4. Yes, absolutely do a git repository. Could be private, could even be public. GitHub now allows sharing private repos between different accounts, so you can have a work and a home GitHub accounts, and share the configs between them. Using gist.GitHub.com is also an option, although you're not allowed by GitHub to have a directory structure there, plus only a single user can have write access, but read is unlimited.