{"id":13572633,"url":"https://github.com/cowboy/dotfiles","last_synced_at":"2025-05-15T20:01:20.145Z","repository":{"id":2084623,"uuid":"3024213","full_name":"cowboy/dotfiles","owner":"cowboy","description":"My Ubuntu / OS X dotfiles.","archived":false,"fork":false,"pushed_at":"2021-09-17T03:43:02.000Z","size":11201,"stargazers_count":1579,"open_issues_count":19,"forks_count":494,"subscribers_count":53,"default_branch":"master","last_synced_at":"2025-04-08T01:37:35.258Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"apache/cordova-ios","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cowboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-21T02:46:35.000Z","updated_at":"2025-04-06T14:59:30.000Z","dependencies_parsed_at":"2022-08-06T12:00:35.696Z","dependency_job_id":null,"html_url":"https://github.com/cowboy/dotfiles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowboy%2Fdotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowboy%2Fdotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowboy%2Fdotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cowboy%2Fdotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cowboy","download_url":"https://codeload.github.com/cowboy/dotfiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414457,"owners_count":22067263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T14:01:28.993Z","updated_at":"2025-05-15T20:01:19.654Z","avatar_url":"https://github.com/cowboy.png","language":"Shell","funding_links":[],"categories":["others","Collections of dotfiles that shared at Github","Shell"],"sub_categories":[],"readme":"# Dotfiles\n\nMy OSX / Ubuntu dotfiles.\n\n## About this project\n\nI've been using bash on-and-off for a long time (since Slackware Linux was distributed on 1.44MB floppy disks). In all that time, every time I've set up a new Linux or OS X machine, I've copied over my `.bashrc` file and my `~/bin` folder to each machine manually. And I've never done a very good job of actually maintaining these files. It's been a total mess.\n\nI finally decided that I wanted to be able to execute a single command to \"bootstrap\" a new system to pull down all of my dotfiles and configs, as well as install all the tools I commonly use. In addition, I wanted to be able to re-execute that command at any time to synchronize anything that might have changed. Finally, I wanted to make it easy to re-integrate changes back in, so that other machines could be updated.\n\nThat command is [dotfiles][dotfiles], and this is my \"dotfiles\" Git repo.\n\n[dotfiles]: bin/dotfiles\n\n## How the \"dotfiles\" command works\n\nWhen [dotfiles][dotfiles] is run for the first time, it does a few things:\n\n1. In Ubuntu, Git is installed if necessary via APT (it's already there in OSX).\n1. This repo is cloned into your user directory, under `~/.dotfiles`.\n1. Files in `/copy` are copied into `~/`. ([read more](#the-copy-step))\n1. Files in `/link` are symlinked into `~/`. ([read more](#the-link-step))\n1. You are prompted to choose scripts in `/init` to be executed. The installer attempts to only select relevant scripts, based on the detected OS and the script filename.\n1. Your chosen init scripts are executed (in alphanumeric order, hence the funky names). ([read more](#the-init-step))\n\nOn subsequent runs, step 1 is skipped, step 2 just updates the already-existing repo, and step 5 remembers what you selected the last time. The other steps are the same.\n\n### Other subdirectories\n\n* The `/backups` directory gets created when necessary. Any files in `~/` that would have been overwritten by files in `/copy` or `/link` get backed up there.\n* The `/bin` directory contains executable shell scripts (including the [dotfiles][dotfiles] script) and symlinks to executable shell scripts. This directory is added to the path.\n* The `/caches` directory contains cached files, used by some scripts or functions.\n* The `/conf` directory just exists. If a config file doesn't **need** to go in `~/`, reference it from the `/conf` directory.\n* The `/source` directory contains files that are sourced whenever a new shell is opened (in alphanumeric order, hence the funky names).\n* The `/test` directory contains unit tests for especially complicated bash functions.\n* The `/vendor` directory contains third-party libraries.\n\n### The \"copy\" step\nAny file in the `/copy` subdirectory will be copied into `~/`. Any file that _needs_ to be modified with personal information (like [copy/.gitconfig](copy/.gitconfig) which contains an email address and private key) should be _copied_ into `~/`. Because the file you'll be editing is no longer in `~/.dotfiles`, it's less likely to be accidentally committed into your public dotfiles repo.\n\n### The \"link\" step\nAny file in the `/link` subdirectory gets symlinked into `~/` with `ln -s`. Edit one or the other, and you change the file in both places. Don't link files containing sensitive data, or you might accidentally commit that data! If you're linking a directory that might contain sensitive data (like `~/.ssh`) add the sensitive files to your [.gitignore](.gitignore) file!\n\n### The \"init\" step\nScripts in the `/init` subdirectory will be executed. A whole bunch of things will be installed, but _only_ if they aren't already.\n\n#### OS X\n\n* Minor XCode init via the [init/10_osx_xcode.sh](init/10_osx_xcode.sh) script\n* Homebrew via the [init/20_osx_homebrew.sh](init/20_osx_homebrew.sh) script\n* Homebrew recipes via the [init/30_osx_homebrew_recipes.sh](init/30_osx_homebrew_recipes.sh) script\n* Homebrew casks via the [init/30_osx_homebrew_casks.sh](init/30_osx_homebrew_casks.sh) script\n* [Fonts](/cowboy/dotfiles/tree/master/conf/osx/fonts) via the [init/50_osx_fonts.sh](init/50_osx_fonts.sh) script\n\n#### Ubuntu\n* APT packages and git-extras via the [init/20_ubuntu_apt.sh](init/20_ubuntu_apt.sh) script\n\n#### Both\n* Node.js, npm and nave via the [init/50_node.sh](init/50_node.sh) script\n* Ruby, gems and rbenv via the [init/50_ruby.sh](init/50_ruby.sh) script\n* Vim plugins via the [init/50_vim.sh](init/50_vim.sh) script\n\n## Hacking my dotfiles\n\nBecause the [dotfiles][dotfiles] script is completely self-contained, you should be able to delete everything else from your dotfiles repo fork, and it will still work. The only thing it really cares about are the `/copy`, `/link` and `/init` subdirectories, which will be ignored if they are empty or don't exist.\n\nIf you modify things and notice a bug or an improvement, [file an issue](https://github.com/cowboy/dotfiles/issues) or [a pull request](https://github.com/cowboy/dotfiles/pulls) and let me know.\n\nAlso, before installing, be sure to [read my gently-worded note](#heed-this-critically-important-warning-before-you-install).\n\n## Installation\n\n### OS X Notes\n\nYou need to have [XCode](https://developer.apple.com/downloads/index.action?=xcode) or, at the very minimum, the [XCode Command Line Tools](https://developer.apple.com/downloads/index.action?=command%20line%20tools), which are available as a much smaller download.\n\nThe easiest way to install the XCode Command Line Tools in OSX 10.9+ is to open up a terminal, type `xcode-select --install` and [follow the prompts](http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/).\n\n_Tested in OSX 10.15_\n\n### Ubuntu Notes\n\nYou might want to set up your ubuntu server [like I do it](https://github.com/cowboy/dotfiles/wiki/ubuntu-setup), but then again, you might not.\n\nEither way, you should at least update/upgrade APT with `sudo apt-get -qq update \u0026\u0026 sudo apt-get -qq dist-upgrade` first.\n\n_Tested in Ubuntu 14.04 LTS_\n\n### Heed this critically important warning before you install\n\n**If you're not me, please _do not_ install dotfiles directly from this repo!**\n\nWhy? Because I often completely break this repo while updating. Which means that if I do that and you run the `dotfiles` command, your home directory will burst into flames, and you'll have to go buy a new computer. No, not really, but it will be very messy.\n\n### Actual installation (for you)\n\n1. [Read my gently-worded note](#heed-this-critically-important-warning-before-you-install)\n1. Fork this repo\n1. Open a terminal/shell and do this (change `cowboy` and `master` as appropriate):\n\n#### Ubuntu\n\n```sh\nexport DOTFILES_GH_USER=cowboy\nexport DOTFILES_GH_BRANCH=master\nbash -c \"$(wget -qO- https://raw.github.com/$DOTFILES_GH_USER/dotfiles/$DOTFILES_GH_BRANCH/bin/dotfiles)\" \u0026\u0026 source ~/.bashrc\n```\n\n#### macOS\n\n```sh\nexport DOTFILES_GH_USER=cowboy\nexport DOTFILES_GH_BRANCH=master\nbash -c \"$(curl -fsSL https://raw.github.com/$DOTFILES_GH_USER/dotfiles/$DOTFILES_GH_BRANCH/bin/dotfiles)\" \u0026\u0026 source ~/.bashrc\n```\n\nSince you'll be using the [dotfiles][dotfiles] command on subsequent runs, you'll only have to set the `DOTFILES_GH_USER` variable for the initial install, but if you have a custom branch, you _will_ need to export `DOTFILES_GH_BRANCH` for subsequent runs.\n\nThere's a lot of stuff that requires admin access via `sudo`, so be warned that you might need to enter your password here or there.\n\n### Actual installation (for me)\n\n#### Ubuntu\n\n```sh\nbash -c \"$(wget -qO- https://bit.ly/cowboy-dotfiles)\" \u0026\u0026 source ~/.bashrc\n```\n\n#### macOS\n\n```sh\nbash -c \"$(curl -fsSL https://bit.ly/cowboy-dotfiles)\" \u0026\u0026 source ~/.bashrc\n```\n\n## Aliases and Functions\nTo keep things easy, the `~/.bashrc` and `~/.bash_profile` files are extremely simple, and should never need to be modified. Instead, add your aliases, functions, settings, etc into one of the files in the `source` subdirectory, or add a new file. They're all automatically sourced when a new shell is opened. Take a look, I have [a lot of aliases and functions](source). I even have a [fancy prompt](source/50_prompt.sh) that shows the current directory, time and current git/svn repo status.\n\n## Scripts\nIn addition to the aforementioned [dotfiles][dotfiles] script, there are a few other [bin scripts](bin). This includes [nave](https://github.com/isaacs/nave), which is a [git submodule](vendor).\n\n* [dotfiles][dotfiles] - (re)initialize dotfiles. It might ask for your password (for `sudo`).\n* [src](link/.bashrc#L8-18) - (re)source all files in `/source` directory\n* Look through the [bin](bin) subdirectory for a few more.\n\n## Prompt\nI think [my bash prompt](source/50_prompt.sh) is awesome. It shows git and svn repo status, a timestamp, error exit codes, and even changes color depending on how you've logged in.\n\nGit repos display as **[branch:flags]** where flags are:\n\n**?** untracked files  \n**!** changed (but unstaged) files  \n**+** staged files\n\nSVN repos display as **[rev1:rev2]** where rev1 and rev2 are:\n\n**rev1** last changed revision  \n**rev2** revision\n\nCheck it out:\n\n![My awesome bash prompt](http://farm8.staticflickr.com/7142/6754488927_563dd73553_b.jpg)\n\n## Inspiration\n\u003chttps://github.com/gf3/dotfiles\u003e  \n\u003chttps://github.com/mathiasbynens/dotfiles\u003e  \n(and 15+ years of accumulated crap)\n\n## License\nCopyright (c) 2014 \"Cowboy\" Ben Alman  \nLicensed under the MIT license.  \n\u003chttp://benalman.com/about/license/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcowboy%2Fdotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcowboy%2Fdotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcowboy%2Fdotfiles/lists"}