From the course: Git for System Administration

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Manage specific user directories

Manage specific user directories - Git Tutorial

From the course: Git for System Administration

Start my 1-month free trial

Manage specific user directories

- [Instructor] Let's discuss the strategy for putting user directories under version control. We may want to include all files in a repository, or we may just want to maintain configuration control on some of the files. Instead of creating a .gitignore file with every single file listed that we don't want, we'll use the power of Git to do the opposite. We'll exclude all files and then allow just what we do want. Make sure that you login as a user and are in your home directory. We'll make the entire home directory a Git project but we'll exclude most files. Let's create a .gitignore file now. Type in vim space .gitignore and hit enter. Go into insert mode by pressing your I key and in this file we'll add one line that excludes all files by typing in /* and hit enter. Now that we've excluded tracking all files in the current directory recursively, let's make an exception for the users bin directory where they will keep their shell scripts. Type in !/bin. Also let's make an exception…

Contents