Creating a repos Directory

The repos directory is a convention I have used for years and teach others for storing all the many Git repos they will use and contribute to over the years. Having these always in a consistent place across multiple devices can be helpful for automation and reduced cognitive overhead.

Change into your home directory.


Or if you wish.

cd ~

Now make the new repos directory.

mkdir repos
ls -ld repos
drwxr-xr-x 16 rob rob 4096 May 18 08:16 repos

Congrats you have a new repos directory. We used the ls -ld command to list the directory in long form and see all of its information.

Now let’s change into it.

cd repos

The cd changes us into the new repo.

The pwd prints the current working directory. It is useful to get your bearings and remember where you are.

💎 When you are advanced enough, you might even want to add the following alias to your bashrc to automatically change into your repos directory.

alias repos="cd $HOME/repos"

Organizing Your Repos

I prefer to organize the stuff in repos the same as where it is hosted — on GitLab, for example. I have ~/repos/skilstak/config/vim under the config subgroup of the skilstak group.