What are dotfiles? Take to take your developer productivity to the next level 🥋👊 by automating the setup of your computer. Go beyond 100 seconds with special guest Patrick McDonald to setup your own dotfiles repo from scratch http://dotfiles.eieio.xyz/

What are dotfiles? https://wiki.archlinux.org/index.php/Dotfiles
Example repo https://github.com/eieioxyz/Beyond-Dotfiles-in-100-Seconds
Full Dotfiles Course http://dotfiles.eieio.xyz/

#dev #learntocode#100SecondsOfCode

Install the quiz app 🤓

iOS https://itunes.apple.com/us/app/fireship/id1462592372?mt=8
Android https://play.google.com/store/apps/details?id=io.fireship.quizapp

Upgrade to Fireship PRO at https://fireship.io/pro
Use code lORhwXd2 for 25% off your first payment. 

My VS Code Theme

- Atom One Dark 
- vscode-icons
- Fira Code Font
2024-02-04T14:18:40.703Z
nova-2
2-general-nova
2024-01-09.29447
30089e05-99d1-4376-b32e-c263170674af
e5ad7817-1ab1-48d3-9edb-30d5f99aa7d8
9526be20c048a6cacb41f9600045a14b1f9b3762a9cbb97a7c2a1bef7e5f409a
67875a7f-c9c4-48a0-aa55-5bdb8a91c34a
deprecated
Dot files.
Set up or restore a fully customized development environment by maintaining a repository of text based config files.
As developers were trained to write dry code, do not repeat yourself.
But this principle also applies to other areas of a developer's life, like the configuration of a development environment.
Imagine this.
You spent months fine tuning your top of the line Intel Mac, but now need to throw it in the garbage because the new Mac mini with an m one chip will blow it out of the water.
Are you going to reinstall and reconfigure everything from scratch?
Hopefully not.
Dot files are those little hidden files on your system that start with a period, like bashprofile.env or git config, just to name a few.
With a repository of these files, you can chronicle the installation of your favorite applications and command line tools.
Keep track of how all that software is configured and record all the various system preferences and changes that you've made to your computer.
These files already live on your system.
And when you harness their power, you can replicate your perfect development environment on a new computer in a completely hands off and automated way.
To get started, you'll want to organize all of your configuration files in a git repository.
That will allow you to track changes and clone the repo on other machines.
Its code will contain at least one script that applies or installs the configurations on a new system, and that means weeks of hard manual labor can be reduced down to a git clone followed by an install script.
Maintaining your own dot files repo will help you develop discipline for other important skills from command line use to git to the organization and inner workings of your machine.
Wax on.
Wax off.
Read.
If you're ready to learn more and build your own dot files repo, Stay tuned.
Today, we're going beyond 100 seconds with special guest, Patrick McDonald.
He's the instructor of a full dot files course and will teach you how to set up your own dot Compose repo step by step, taking your developer productivity to the next level.
YouTube, meet Patrick.
Over the last 20 plus years, I've set up enough computers To have acquired an appreciation of automating that process, and I've gathered a few tricks I'd like to share with you.
Hello, everyone.
I'm Patrick, and I'll be your guide as we go beyond 100 seconds to learn how to back up a few typical dot files Without disturbing your computer's ability to use those files to configure software.
If you've never heard of dotfiles, you're probably familiar The home directory that looks like this.
But as Jeff mentioned, macOS is littered with hidden files.
Versus Code is open to the same home directory And its file explorer shows several more items.
We can tell Finder to show the same hidden files by entering the key combination command shift period.
Most hidden files have a dot prefix, hence the name dot files.
They can be folders as well as files.
And in special cases, they can be hidden by the operating system even though they are missing the dot.
That's all we need to know about finder.
So let's look at v s code where we can see that our system uses dotfiles in our home directory, software that comes preinstalled uses hidden files too, And so does the custom software that we install on our own.
If you've been using your computer for a significant amount of time, you likely have many more dot files here.
We are going to focus on these 2 at the bottom, git config and zshrc.
When you started using Git, You probably issued a pair of commands to set your name and email address.
Those settings ended up here in the git config file.
As you continue learning and using Git, this file can grow with more configurations.
Before we move on, Let me recommend using the no reply email address available with your GitHub account.
When you publish your dotfiles repo for the world to see, This lets you keep your personal email address a secret.
Z s h is the new default shell on macOS, and the zshrc file is what you use to customize the shell experience.
So far, we are only using this to customize the prompt.
But like we saw with the git config file, we can add to this file in many ways.
We already have 2 files that are going to change over time.
What does this mean?
Yes.
It means we're going to need a Git repository to start tracking these files along with the changes we make to them.
Let's open the integrated terminal where we can see our super fancy custom prompt in action and where we can see that we start off in the home directory.
I've already set up a repository on GitHub, so I'll start a git clone command and paste in the SSH URL.
Now we need to tell it the directory to create.
And since everybody else is doing it, let's make a hidden folder by prefixing our dot files repo with a period.
Our new directory has a readme that we will look at shortly, but let's start by moving these 2 dot files into the repo so we can back them up.
Of course, the act of moving them isn't enough, and these two files are still untracked.
So we will c d into the dotfiles directory Where we can add the 2 files to the repository, and then we will commit them.
But is this all we have to do?
Will we be done after entering this command?
Let's try it.
And it looks like we have a problem.
Instead of using the user information that we just saw in our git config, The output says that Git automatically configured this committer information based on the username and host name.
Remember that software likes to use our home directory.
So by moving this file to a different location, we've broken the configuration.
Every time we make a commit, Git will remind us of this problem.
Let's copy this suggested command about resetting the author and amending the commit, And we will try to fix this in a few minutes.
What about our z s h configurations?
I think we can assume that these are broken as well.
Keep an eye on the file explorer to the left as I kill this terminal.
When a shell session ends, its command history is written out.
And as software continues to add files to our home directory, we have to decide whether to move these files to our repository.
Z s h history is not the type of file we want to track in our repo.
So we will leave it here in the home directory.
We just saw that zsh writes to our home directory, but it tries to read from it as well.
If we open a new shell, we see that we've lost our custom prompt Because zsh could not find the zshrc file.
Instead, we see the default prompt, which happens to have a similar default to the one we just saw for git Using the same username and hostname combination.
How do we fix these broken configurations?
We don't want to duplicate these files, Store their copies in the home directory and manually keep them in sync.
Luckily, there's a way that a file can be in 2 places at the same time, Which is called a symbolic link or symlink for short.
To create one, we will use the l m or link command.
Then we will add the s option which stands for symbolic link.
Now we'll pass in the full path to the real file in our dot files directory.
And lastly, we'll pass in the path to the original location where the zshrc file is expected to live.
The file explorer now shows that the zshrc file is back in the home directory, but it has an arrow to the right which signifies that this is a Symlink.
If that arrow does not show up for you, reload the window and it should appear.
Now I'll kill the terminal again and open the new Symlink version from the home directory To the right of the zshrc file in our dotfiles directory, they both look like normal files, don't they?
But if I add a comment to the real file and save it, We can see that changes to the real file at the left will show up in the Symlink version at the right.
Of course, we can delete these lines from the right, and After another save, those changes are reflected at the left.
Since Versus Code can follow the SymLink to the real file and treat it as a real file, I bet zsh can too.
If we open a new shell, we see our custom prompt has returned.
When a shell loads, It looks for the zshrc file in the home directory, which follows the symlink to the real file, and the customization makes it into the shell.
Not only did the shell load the zshrc file, it also loaded the zsh history file, which is still in the home directory.
This means we have access to previous commands.
I can press up to retrieve the most recent command from the history And then alter it to create a SYMLink for the git config file, which we see appear in the Explorer with another arrow icon.
We've seen enough of the home directory.
So before testing our git config fix, let's open only the dotfiles directory.
The key combo we used in finder to show hidden files, command shift period, works here as well.
Of course, the arrows here on the file icons mean the same thing they do in the file explorer.
After opening the dot files directory, we have less clutter to look at.
Since we have the dot Files directory open in Versus Code, the integrated terminal will start at the same location when we fire up a new shell.
A git log command will remind us that our last commit has the wrong author, which happened because we moved the git config file.
We can check to see if our second symlink is working by checking the global git config for the email address, which shows The correct no reply email address that we saw before.
Now I'll paste in the command that I copied a bit ago.
If you issue this command as is, You'll end up editing the commit in Vim because it is the default editor.
And if you're like me, it will take you half an hour to figure out how to exit Vim.
Changing the default editor, perhaps to nano or Versus Code, is the type of configuration you could make to your git config file, and the change would be tracked in your repo.
But in this case, we don't actually want to edit the contents of the commit, so we can add the no edit option.
Another look at the git log shows that the author information has been corrected.
We have successfully backed up our configurations while preserving the ability to use them.
But that won't do a lot of good if our software is not installed.
We need an automated way of installing software.
And for that, we will use a package manager called Homebrew.
It just so happens that I used Homebrew to install Versus Code along with some other software.
We don't have time to learn much about it, but Homebrew keeps track of what it has installed and can output a list of software with this command.
After brew bundle dump, I'll add the describe option for a little more info.
This command will create a file in your current directory, so it's important that we are Already in our dotfiles repo.
Our new brew file has a list of software that can be reinstalled at a later date.
TAPs are the repositories where Homebrew keeps own software, along with the information about the other software it can install.
BRUs are tools you typically use in your shell.
These top 2 are new tools I've added to improve my shell experience, while these bottom 2 are upgraded versions of pre installed software.
So Homebrew helps keep everything up to date, and the casks at the bottom are full blown applications that you probably recognize.
Let's start one last shell, Add the brew file to start tracking it and do another commit.
Note that this time, we did not get the warning message that we saw before about automatically configuring the author.
That's another sign that our git config sem link is working, so we will push our changes to the remote repository.
Now we've saved our software along with some configurations, but we haven't recorded the process.
When the time comes to bootstrap a new computer using our dot files repository, we are likely to forget some steps.
Instead of researching and relearning these things, we can keep a list in the readme.
We haven't seen this first step yet.
Before we can use git and homebrew, we would need to install the command line tools.
After that, we would clone the repository to our new machine.
SSH is preferred, but you might want to start with h t t p s and switch remotes After you've had a chance to set up SSH with our configuration files on our machine, we would then repeat our sim linking steps.
You can probably see that this would be unwieldy if we had a dozen symlinks.
And the more manual steps we have, the more error prone our process.
There are better ways to do this, and this is the type of thing you'd eventually work into an install script.
Finally, we would install Homebrew And then point it to our brew file to reinstall all of our software.
I really wish we had the time to see this step in action because it is very satisfying.
Just like we saw in the git config and the zshrc files, here we have another list of ideas regarding improving our dotfiles process.
We haven't looked at saving system preferences, organizing this repo into separate files, building that install script, Or automating any of the steps we did.
There are 110000000 possibilities which we can't cover in 10 minutes, let alone 100 seconds.
But as Jeff mentioned, I have a growing course that thoroughly covers this material.
And for the next 30 days, I'll keep The price is low as the course platform allows.
Enroll now and your next computer setup will be no match for your dot file skills.
Thank you for watching.
And since there's no way I could possibly thank Jeff enough for sharing his stage with me, please thank him on my behalf by liking and Sharing his videos, subscribing to this channel, and going pro at FireShip IO.
Thanks for watching, and I will see you in the next one.

Speaker 0: Dot files. Set up or restore a fully customized development environment by maintaining a repository of text based config files. As developers were trained to write dry code, do not repeat yourself. But this principle also applies to other areas of a developer's life, like the configuration of a development environment. Imagine this.

You spent months fine tuning your top of the line Intel Mac, but now need to throw it in the garbage because the new Mac mini with an m one chip will blow it out of the water. Are you going to reinstall and reconfigure everything from scratch? Hopefully not. Dot files are those little hidden files on your system that start with a period, like bashprofile.env or git config, just to name a few. With a repository of these files, you can chronicle the installation of your favorite applications and command line tools.

Keep track of how all that software is configured and record all the various system preferences and changes that you've made to your computer. These files already live on your system. And when you harness their power, you can replicate your perfect development environment on a new computer in a completely hands off and automated way. To get started, you'll want to organize all of your configuration files in a git repository. That will allow you to track changes and clone the repo on other machines.

Its code will contain at least one script that applies or installs the configurations on a new system, and that means weeks of hard manual labor can be reduced down to a git clone followed by an install script. Maintaining your own dot files repo will help you develop discipline for other important skills from command line use to git to the organization and inner workings of your machine. Wax on. Wax off. Read.

If you're ready to learn more and build your own dot files repo, Stay tuned. Today, we're going beyond 100 seconds with special guest, Patrick McDonald. He's the instructor of a full dot files course and will teach you how to set up your own dot Compose repo step by step, taking your developer productivity to the next level. YouTube, meet Patrick.

Speaker 1: Over the last 20 plus years, I've set up enough computers To have acquired an appreciation of automating that process, and I've gathered a few tricks I'd like to share with you. Hello, everyone. I'm Patrick, and I'll be your guide as we go beyond 100 seconds to learn how to back up a few typical dot files Without disturbing your computer's ability to use those files to configure software. If you've never heard of dotfiles, you're probably familiar The home directory that looks like this. But as Jeff mentioned, macOS is littered with hidden files.

Versus Code is open to the same home directory And its file explorer shows several more items. We can tell Finder to show the same hidden files by entering the key combination command shift period. Most hidden files have a dot prefix, hence the name dot files. They can be folders as well as files. And in special cases, they can be hidden by the operating system even though they are missing the dot.

That's all we need to know about finder. So let's look at v s code where we can see that our system uses dotfiles in our home directory, software that comes preinstalled uses hidden files too, And so does the custom software that we install on our own. If you've been using your computer for a significant amount of time, you likely have many more dot files here. We are going to focus on these 2 at the bottom, git config and zshrc. When you started using Git, You probably issued a pair of commands to set your name and email address.

Those settings ended up here in the git config file. As you continue learning and using Git, this file can grow with more configurations. Before we move on, Let me recommend using the no reply email address available with your GitHub account. When you publish your dotfiles repo for the world to see, This lets you keep your personal email address a secret. Z s h is the new default shell on macOS, and the zshrc file is what you use to customize the shell experience.

So far, we are only using this to customize the prompt. But like we saw with the git config file, we can add to this file in many ways. We already have 2 files that are going to change over time. What does this mean? Yes.

It means we're going to need a Git repository to start tracking these files along with the changes we make to them. Let's open the integrated terminal where we can see our super fancy custom prompt in action and where we can see that we start off in the home directory. I've already set up a repository on GitHub, so I'll start a git clone command and paste in the SSH URL. Now we need to tell it the directory to create. And since everybody else is doing it, let's make a hidden folder by prefixing our dot files repo with a period.

Our new directory has a readme that we will look at shortly, but let's start by moving these 2 dot files into the repo so we can back them up. Of course, the act of moving them isn't enough, and these two files are still untracked. So we will c d into the dotfiles directory Where we can add the 2 files to the repository, and then we will commit them. But is this all we have to do? Will we be done after entering this command?

Let's try it. And it looks like we have a problem. Instead of using the user information that we just saw in our git config, The output says that Git automatically configured this committer information based on the username and host name. Remember that software likes to use our home directory. So by moving this file to a different location, we've broken the configuration.

Every time we make a commit, Git will remind us of this problem. Let's copy this suggested command about resetting the author and amending the commit, And we will try to fix this in a few minutes. What about our z s h configurations? I think we can assume that these are broken as well. Keep an eye on the file explorer to the left as I kill this terminal.

When a shell session ends, its command history is written out. And as software continues to add files to our home directory, we have to decide whether to move these files to our repository. Z s h history is not the type of file we want to track in our repo. So we will leave it here in the home directory. We just saw that zsh writes to our home directory, but it tries to read from it as well.

If we open a new shell, we see that we've lost our custom prompt Because zsh could not find the zshrc file. Instead, we see the default prompt, which happens to have a similar default to the one we just saw for git Using the same username and hostname combination. How do we fix these broken configurations? We don't want to duplicate these files, Store their copies in the home directory and manually keep them in sync. Luckily, there's a way that a file can be in 2 places at the same time, Which is called a symbolic link or symlink for short.

To create one, we will use the l m or link command. Then we will add the s option which stands for symbolic link. Now we'll pass in the full path to the real file in our dot files directory. And lastly, we'll pass in the path to the original location where the zshrc file is expected to live. The file explorer now shows that the zshrc file is back in the home directory, but it has an arrow to the right which signifies that this is a Symlink.

If that arrow does not show up for you, reload the window and it should appear. Now I'll kill the terminal again and open the new Symlink version from the home directory To the right of the zshrc file in our dotfiles directory, they both look like normal files, don't they? But if I add a comment to the real file and save it, We can see that changes to the real file at the left will show up in the Symlink version at the right. Of course, we can delete these lines from the right, and After another save, those changes are reflected at the left. Since Versus Code can follow the SymLink to the real file and treat it as a real file, I bet zsh can too.

If we open a new shell, we see our custom prompt has returned. When a shell loads, It looks for the zshrc file in the home directory, which follows the symlink to the real file, and the customization makes it into the shell. Not only did the shell load the zshrc file, it also loaded the zsh history file, which is still in the home directory. This means we have access to previous commands. I can press up to retrieve the most recent command from the history And then alter it to create a SYMLink for the git config file, which we see appear in the Explorer with another arrow icon.

We've seen enough of the home directory. So before testing our git config fix, let's open only the dotfiles directory. The key combo we used in finder to show hidden files, command shift period, works here as well. Of course, the arrows here on the file icons mean the same thing they do in the file explorer. After opening the dot files directory, we have less clutter to look at.

Since we have the dot Files directory open in Versus Code, the integrated terminal will start at the same location when we fire up a new shell. A git log command will remind us that our last commit has the wrong author, which happened because we moved the git config file. We can check to see if our second symlink is working by checking the global git config for the email address, which shows The correct no reply email address that we saw before. Now I'll paste in the command that I copied a bit ago. If you issue this command as is, You'll end up editing the commit in Vim because it is the default editor.

And if you're like me, it will take you half an hour to figure out how to exit Vim. Changing the default editor, perhaps to nano or Versus Code, is the type of configuration you could make to your git config file, and the change would be tracked in your repo. But in this case, we don't actually want to edit the contents of the commit, so we can add the no edit option. Another look at the git log shows that the author information has been corrected. We have successfully backed up our configurations while preserving the ability to use them.

But that won't do a lot of good if our software is not installed. We need an automated way of installing software. And for that, we will use a package manager called Homebrew. It just so happens that I used Homebrew to install Versus Code along with some other software. We don't have time to learn much about it, but Homebrew keeps track of what it has installed and can output a list of software with this command.

After brew bundle dump, I'll add the describe option for a little more info. This command will create a file in your current directory, so it's important that we are Already in our dotfiles repo. Our new brew file has a list of software that can be reinstalled at a later date. TAPs are the repositories where Homebrew keeps own software, along with the information about the other software it can install. BRUs are tools you typically use in your shell.

These top 2 are new tools I've added to improve my shell experience, while these bottom 2 are upgraded versions of pre installed software. So Homebrew helps keep everything up to date, and the casks at the bottom are full blown applications that you probably recognize. Let's start one last shell, Add the brew file to start tracking it and do another commit. Note that this time, we did not get the warning message that we saw before about automatically configuring the author. That's another sign that our git config sem link is working, so we will push our changes to the remote repository.

Now we've saved our software along with some configurations, but we haven't recorded the process. When the time comes to bootstrap a new computer using our dot files repository, we are likely to forget some steps. Instead of researching and relearning these things, we can keep a list in the readme. We haven't seen this first step yet. Before we can use git and homebrew, we would need to install the command line tools.

After that, we would clone the repository to our new machine. SSH is preferred, but you might want to start with h t t p s and switch remotes After you've had a chance to set up SSH with our configuration files on our machine, we would then repeat our sim linking steps. You can probably see that this would be unwieldy if we had a dozen symlinks. And the more manual steps we have, the more error prone our process. There are better ways to do this, and this is the type of thing you'd eventually work into an install script.

Finally, we would install Homebrew And then point it to our brew file to reinstall all of our software. I really wish we had the time to see this step in action because it is very satisfying. Just like we saw in the git config and the zshrc files, here we have another list of ideas regarding improving our dotfiles process. We haven't looked at saving system preferences, organizing this repo into separate files, building that install script, Or automating any of the steps we did. There are 110000000 possibilities which we can't cover in 10 minutes, let alone 100 seconds.

But as Jeff mentioned, I have a growing course that thoroughly covers this material. And for the next 30 days, I'll keep The price is low as the course platform allows. Enroll now and your next computer setup will be no match for your dot file skills. Thank you for watching. And since there's no way I could possibly thank Jeff enough for sharing his stage with me, please thank him on my behalf by liking and Sharing his videos, subscribing to this channel, and going pro at FireShip IO.

Speaker 0: Thanks for watching, and I will see you in the next one.
Dot files. Set up or restore a fully customized development environment by maintaining a repository of text based config files. As developers were trained to write dry code, do not repeat yourself. But this principle also applies to other areas of a developer's life, like the configuration of a development environment. Imagine this. You spent months fine tuning your top of the line Intel Mac, but now need to throw it in the garbage because the new Mac mini with an m one chip will blow it out of the water.
computer science
software development
home improvement
Are you going to reinstall and reconfigure everything from scratch? Hopefully not. Dot files are those little hidden files on your system that start with a period, like bashprofile.env or git config, just to name a few.
With a repository of these files, you can chronicle the installation of your favorite applications and command line tools. Keep track of how all that software is configured and record all the various system preferences and changes that you've made to your computer. These files already live on your system. And when you harness their power, you can replicate your perfect development environment on a new computer in a completely hands off and automated way. To get started, you'll want to organize all of your configuration files in a git repository. That will allow you to track changes and clone the repo on other machines.
software
software development
Its code will contain at least one script that applies or installs the configurations on a new system, and that means weeks of hard manual labor can be reduced down to a git clone followed by an install script. Maintaining your own dot files repo will help you develop discipline for other important skills from command line use to git to the organization and inner workings of your machine. Wax on. Wax off. Read. If you're ready to learn more and build your own dot files repo, Stay tuned. Today, we're going beyond 100 seconds with special guest, Patrick McDonald.
He's the instructor of a full dot files course and will teach you how to set up your own dot Compose repo step by step, taking your developer productivity to the next level. YouTube, meet Patrick. Over the last 20 plus years, I've set up enough computers To have acquired an appreciation of automating that process, and I've gathered a few tricks I'd like to share with you. Hello, everyone. I'm Patrick, and I'll be your guide as we go beyond 100 seconds to learn how to back up a few typical dot files Without disturbing your computer's ability to use those files to configure software.
youtube
If you've never heard of dotfiles, you're probably familiar The home directory that looks like this. But as Jeff mentioned, macOS is littered with hidden files. Versus Code is open to the same home directory And its file explorer shows several more items. We can tell Finder to show the same hidden files by entering the key combination command shift period. Most hidden files have a dot prefix, hence the name dot files. They can be folders as well as files. And in special cases, they can be hidden by the operating system even though they are missing the dot. That's all we need to know about finder. So let's look at v s code where we can see that our system uses dotfiles in our home directory, software that comes preinstalled uses hidden files too, And so does the custom software that we install on our own. If you've been using your computer for a significant amount of time, you likely have many more dot files here. We are going to focus on these 2 at the bottom, git config and zshrc. When you started using Git, You probably issued a pair of commands to set your name and email address. Those settings ended up here in the git config file. As you continue learning and using Git, this file can grow with more configurations. Before we move on, Let me recommend using the no reply email address available with your GitHub account. When you publish your dotfiles repo for the world to see, This lets you keep your personal email address a secret. Z s h is the new default shell on macOS, and the zshrc file is what you use to customize the shell experience. So far, we are only using this to customize the prompt. But like we saw with the git config file, we can add to this file in many ways. We already have 2 files that are going to change over time. What does this mean? Yes. It means we're going to need a Git repository to start tracking these files along with the changes we make to them. Let's open the integrated terminal where we can see our super fancy custom prompt in action and where we can see that we start off in the home directory. I've already set up a repository on GitHub, so I'll start a git clone command and paste in the SSH URL. Now we need to tell it the directory to create. And since everybody else is doing it, let's make a hidden folder by prefixing our dot files repo with a period. Our new directory has a readme that we will look at shortly, but let's start by moving these 2 dot files into the repo so we can back them up. Of course, the act of moving them isn't enough, and these two files are still untracked. So we will c d into the dotfiles directory Where we can add the 2 files to the repository, and then we will commit them. But is this all we have to do? Will we be done after entering this command? Let's try it. And it looks like we have a problem. Instead of using the user information that we just saw in our git config, The output says that Git automatically configured this committer information based on the username and host name. Remember that software likes to use our home directory. So by moving this file to a different location, we've broken the configuration. Every time we make a commit, Git will remind us of this problem. Let's copy this suggested command about resetting the author and amending the commit, And we will try to fix this in a few minutes. What about our z s h configurations? I think we can assume that these are broken as well. Keep an eye on the file explorer to the left as I kill this terminal. When a shell session ends, its command history is written out. And as software continues to add files to our home directory, we have to decide whether to move these files to our repository. Z s h history is not the type of file we want to track in our repo. So we will leave it here in the home directory. We just saw that zsh writes to our home directory, but it tries to read from it as well. If we open a new shell, we see that we've lost our custom prompt Because zsh could not find the zshrc file. Instead, we see the default prompt, which happens to have a similar default to the one we just saw for git Using the same username and hostname combination. How do we fix these broken configurations? We don't want to duplicate these files, Store their copies in the home directory and manually keep them in sync. Luckily, there's a way that a file can be in 2 places at the same time, Which is called a symbolic link or symlink for short. To create one, we will use the l m or link command. Then we will add the s option which stands for symbolic link. Now we'll pass in the full path to the real file in our dot files directory. And lastly, we'll pass in the path to the original location where the zshrc file is expected to live. The file explorer now shows that the zshrc file is back in the home directory, but it has an arrow to the right which signifies that this is a Symlink. If that arrow does not show up for you, reload the window and it should appear. Now I'll kill the terminal again and open the new Symlink version from the home directory To the right of the zshrc file in our dotfiles directory, they both look like normal files, don't they? But if I add a comment to the real file and save it, We can see that changes to the real file at the left will show up in the Symlink version at the right. Of course, we can delete these lines from the right, and After another save, those changes are reflected at the left. Since Versus Code can follow the SymLink to the real file and treat it as a real file, I bet zsh can too. If we open a new shell, we see our custom prompt has returned. When a shell loads, It looks for the zshrc file in the home directory, which follows the symlink to the real file, and the customization makes it into the shell. Not only did the shell load the zshrc file, it also loaded the zsh history file, which is still in the home directory. This means we have access to previous commands. I can press up to retrieve the most recent command from the history And then alter it to create a SYMLink for the git config file, which we see appear in the Explorer with another arrow icon. We've seen enough of the home directory. So before testing our git config fix, let's open only the dotfiles directory. The key combo we used in finder to show hidden files, command shift period, works here as well. Of course, the arrows here on the file icons mean the same thing they do in the file explorer. After opening the dot files directory, we have less clutter to look at. Since we have the dot Files directory open in Versus Code, the integrated terminal will start at the same location when we fire up a new shell. A git log command will remind us that our last commit has the wrong author, which happened because we moved the git config file. We can check to see if our second symlink is working by checking the global git config for the email address, which shows The correct no reply email address that we saw before. Now I'll paste in the command that I copied a bit ago. If you issue this command as is, You'll end up editing the commit in Vim because it is the default editor. And if you're like me, it will take you half an hour to figure out how to exit Vim. Changing the default editor, perhaps to nano or Versus Code, is the type of configuration you could make to your git config file, and the change would be tracked in your repo. But in this case, we don't actually want to edit the contents of the commit, so we can add the no edit option. Another look at the git log shows that the author information has been corrected.
We have successfully backed up our configurations while preserving the ability to use them. But that won't do a lot of good if our software is not installed. We need an automated way of installing software. And for that, we will use a package manager called Homebrew. It just so happens that I used Homebrew to install Versus Code along with some other software. We don't have time to learn much about it, but Homebrew keeps track of what it has installed and can output a list of software with this command.
software
home improvement
software development
After brew bundle dump, I'll add the describe option for a little more info. This command will create a file in your current directory, so it's important that we are Already in our dotfiles repo.
Our new brew file has a list of software that can be reinstalled at a later date. TAPs are the repositories where Homebrew keeps own software, along with the information about the other software it can install. BRUs are tools you typically use in your shell. These top 2 are new tools I've added to improve my shell experience, while these bottom 2 are upgraded versions of pre installed software.
software
marijuana
So Homebrew helps keep everything up to date, and the casks at the bottom are full blown applications that you probably recognize. Let's start one last shell, Add the brew file to start tracking it and do another commit. Note that this time, we did not get the warning message that we saw before about automatically configuring the author. That's another sign that our git config sem link is working, so we will push our changes to the remote repository. Now we've saved our software along with some configurations, but we haven't recorded the process. When the time comes to bootstrap a new computer using our dot files repository, we are likely to forget some steps. Instead of researching and relearning these things, we can keep a list in the readme. We haven't seen this first step yet. Before we can use git and homebrew, we would need to install the command line tools. After that, we would clone the repository to our new machine. SSH is preferred, but you might want to start with h t t p s and switch remotes After you've had a chance to set up SSH with our configuration files on our machine, we would then repeat our sim linking steps. You can probably see that this would be unwieldy if we had a dozen symlinks. And the more manual steps we have, the more error prone our process.
There are better ways to do this, and this is the type of thing you'd eventually work into an install script. Finally, we would install Homebrew And then point it to our brew file to reinstall all of our software. I really wish we had the time to see this step in action because it is very satisfying.
home improvement
software development
Just like we saw in the git config and the zshrc files, here we have another list of ideas regarding improving our dotfiles process. We haven't looked at saving system preferences, organizing this repo into separate files, building that install script, Or automating any of the steps we did. There are 110000000 possibilities which we can't cover in 10 minutes, let alone 100 seconds. But as Jeff mentioned, I have a growing course that thoroughly covers this material. And for the next 30 days, I'll keep The price is low as the course platform allows. Enroll now and your next computer setup will be no match for your dot file skills. Thank you for watching. And since there's no way I could possibly thank Jeff enough for sharing his stage with me, please thank him on my behalf by liking and Sharing his videos, subscribing to this channel, and going pro at FireShip IO. Thanks for watching, and I will see you in the next one.
Dot files. Set up or restore a fully customized development environment by maintaining a repository of text based config files. As developers were trained to write dry code, do not repeat yourself. But this principle also applies to other areas of a developer's life, like the configuration of a development environment. Imagine this. You spent months fine tuning your top of the line Intel Mac, but now need to throw it in the garbage because the new Mac mini with an m one chip will blow it out of the water. Are you going to reinstall and reconfigure everything from scratch? Hopefully not. Dot files are those little hidden files on your system that start with a period, like bashprofile.env or git config, just to name a few. With a repository of these files, you can chronicle the installation of your favorite applications and command line tools. Keep track of how all that software is configured and record all the various system preferences and changes that you've made to your computer. These files already live on your system. And when you harness their power, you can replicate your perfect development environment on a new computer in a completely hands off and automated way. To get started, you'll want to organize all of your configuration files in a git repository. That will allow you to track changes and clone the repo on other machines. Its code will contain at least one script that applies or installs the configurations on a new system, and that means weeks of hard manual labor can be reduced down to a git clone followed by an install script. Maintaining your own dot files repo will help you develop discipline for other important skills from command line use to git to the organization and inner workings of your machine. Wax on. Wax off. Read. If you're ready to learn more and build your own dot files repo, Stay tuned. Today, we're going beyond 100 seconds with special guest, Patrick McDonald. He's the instructor of a full dot files course and will teach you how to set up your own dot Compose repo step by step, taking your developer productivity to the next level. YouTube, meet Patrick. Over the last 20 plus years, I've set up enough computers To have acquired an appreciation of automating that process, and I've gathered a few tricks I'd like to share with you. Hello, everyone. I'm Patrick, and I'll be your guide as we go beyond 100 seconds to learn how to back up a few typical dot files Without disturbing your computer's ability to use those files to configure software. If you've never heard of dotfiles, you're probably familiar The home directory that looks like this. But as Jeff mentioned, macOS is littered with hidden files. Versus Code is open to the same home directory And its file explorer shows several more items. We can tell Finder to show the same hidden files by entering the key combination command shift period. Most hidden files have a dot prefix, hence the name dot files. They can be folders as well as files. And in special cases, they can be hidden by the operating system even though they are missing the dot. That's all we need to know about finder. So let's look at v s code where we can see that our system uses dotfiles in our home directory, software that comes preinstalled uses hidden files too, And so does the custom software that we install on our own. If you've been using your computer for a significant amount of time, you likely have many more dot files here. We are going to focus on these 2 at the bottom, git config and zshrc. When you started using Git, You probably issued a pair of commands to set your name and email address. Those settings ended up here in the git config file. As you continue learning and using Git, this file can grow with more configurations. Before we move on, Let me recommend using the no reply email address available with your GitHub account. When you publish your dotfiles repo for the world to see, This lets you keep your personal email address a secret. Z s h is the new default shell on macOS, and the zshrc file is what you use to customize the shell experience. So far, we are only using this to customize the prompt. But like we saw with the git config file, we can add to this file in many ways. We already have 2 files that are going to change over time. What does this mean? Yes. It means we're going to need a Git repository to start tracking these files along with the changes we make to them. Let's open the integrated terminal where we can see our super fancy custom prompt in action and where we can see that we start off in the home directory. I've already set up a repository on GitHub, so I'll start a git clone command and paste in the SSH URL. Now we need to tell it the directory to create. And since everybody else is doing it, let's make a hidden folder by prefixing our dot files repo with a period. Our new directory has a readme that we will look at shortly, but let's start by moving these 2 dot files into the repo so we can back them up. Of course, the act of moving them isn't enough, and these two files are still untracked. So we will c d into the dotfiles directory Where we can add the 2 files to the repository, and then we will commit them. But is this all we have to do? Will we be done after entering this command? Let's try it. And it looks like we have a problem. Instead of using the user information that we just saw in our git config, The output says that Git automatically configured this committer information based on the username and host name. Remember that software likes to use our home directory. So by moving this file to a different location, we've broken the configuration. Every time we make a commit, Git will remind us of this problem. Let's copy this suggested command about resetting the author and amending the commit, And we will try to fix this in a few minutes. What about our z s h configurations? I think we can assume that these are broken as well. Keep an eye on the file explorer to the left as I kill this terminal. When a shell session ends, its command history is written out. And as software continues to add files to our home directory, we have to decide whether to move these files to our repository. Z s h history is not the type of file we want to track in our repo. So we will leave it here in the home directory. We just saw that zsh writes to our home directory, but it tries to read from it as well. If we open a new shell, we see that we've lost our custom prompt Because zsh could not find the zshrc file. Instead, we see the default prompt, which happens to have a similar default to the one we just saw for git Using the same username and hostname combination. How do we fix these broken configurations? We don't want to duplicate these files, Store their copies in the home directory and manually keep them in sync. Luckily, there's a way that a file can be in 2 places at the same time, Which is called a symbolic link or symlink for short. To create one, we will use the l m or link command. Then we will add the s option which stands for symbolic link. Now we'll pass in the full path to the real file in our dot files directory. And lastly, we'll pass in the path to the original location where the zshrc file is expected to live. The file explorer now shows that the zshrc file is back in the home directory, but it has an arrow to the right which signifies that this is a Symlink. If that arrow does not show up for you, reload the window and it should appear. Now I'll kill the terminal again and open the new Symlink version from the home directory To the right of the zshrc file in our dotfiles directory, they both look like normal files, don't they? But if I add a comment to the real file and save it, We can see that changes to the real file at the left will show up in the Symlink version at the right. Of course, we can delete these lines from the right, and After another save, those changes are reflected at the left. Since Versus Code can follow the SymLink to the real file and treat it as a real file, I bet zsh can too. If we open a new shell, we see our custom prompt has returned. When a shell loads, It looks for the zshrc file in the home directory, which follows the symlink to the real file, and the customization makes it into the shell. Not only did the shell load the zshrc file, it also loaded the zsh history file, which is still in the home directory. This means we have access to previous commands. I can press up to retrieve the most recent command from the history And then alter it to create a SYMLink for the git config file, which we see appear in the Explorer with another arrow icon. We've seen enough of the home directory. So before testing our git config fix, let's open only the dotfiles directory. The key combo we used in finder to show hidden files, command shift period, works here as well. Of course, the arrows here on the file icons mean the same thing they do in the file explorer. After opening the dot files directory, we have less clutter to look at. Since we have the dot Files directory open in Versus Code, the integrated terminal will start at the same location when we fire up a new shell. A git log command will remind us that our last commit has the wrong author, which happened because we moved the git config file. We can check to see if our second symlink is working by checking the global git config for the email address, which shows The correct no reply email address that we saw before. Now I'll paste in the command that I copied a bit ago. If you issue this command as is, You'll end up editing the commit in Vim because it is the default editor. And if you're like me, it will take you half an hour to figure out how to exit Vim. Changing the default editor, perhaps to nano or Versus Code, is the type of configuration you could make to your git config file, and the change would be tracked in your repo. But in this case, we don't actually want to edit the contents of the commit, so we can add the no edit option. Another look at the git log shows that the author information has been corrected. We have successfully backed up our configurations while preserving the ability to use them. But that won't do a lot of good if our software is not installed. We need an automated way of installing software. And for that, we will use a package manager called Homebrew. It just so happens that I used Homebrew to install Versus Code along with some other software. We don't have time to learn much about it, but Homebrew keeps track of what it has installed and can output a list of software with this command. After brew bundle dump, I'll add the describe option for a little more info. This command will create a file in your current directory, so it's important that we are Already in our dotfiles repo. Our new brew file has a list of software that can be reinstalled at a later date. TAPs are the repositories where Homebrew keeps own software, along with the information about the other software it can install. BRUs are tools you typically use in your shell. These top 2 are new tools I've added to improve my shell experience, while these bottom 2 are upgraded versions of pre installed software. So Homebrew helps keep everything up to date, and the casks at the bottom are full blown applications that you probably recognize. Let's start one last shell, Add the brew file to start tracking it and do another commit. Note that this time, we did not get the warning message that we saw before about automatically configuring the author. That's another sign that our git config sem link is working, so we will push our changes to the remote repository. Now we've saved our software along with some configurations, but we haven't recorded the process. When the time comes to bootstrap a new computer using our dot files repository, we are likely to forget some steps. Instead of researching and relearning these things, we can keep a list in the readme. We haven't seen this first step yet. Before we can use git and homebrew, we would need to install the command line tools. After that, we would clone the repository to our new machine. SSH is preferred, but you might want to start with h t t p s and switch remotes After you've had a chance to set up SSH with our configuration files on our machine, we would then repeat our sim linking steps. You can probably see that this would be unwieldy if we had a dozen symlinks. And the more manual steps we have, the more error prone our process. There are better ways to do this, and this is the type of thing you'd eventually work into an install script. Finally, we would install Homebrew And then point it to our brew file to reinstall all of our software. I really wish we had the time to see this step in action because it is very satisfying. Just like we saw in the git config and the zshrc files, here we have another list of ideas regarding improving our dotfiles process. We haven't looked at saving system preferences, organizing this repo into separate files, building that install script, Or automating any of the steps we did. There are 110000000 possibilities which we can't cover in 10 minutes, let alone 100 seconds. But as Jeff mentioned, I have a growing course that thoroughly covers this material. And for the next 30 days, I'll keep The price is low as the course platform allows. Enroll now and your next computer setup will be no match for your dot file skills. Thank you for watching. And since there's no way I could possibly thank Jeff enough for sharing his stage with me, please thank him on my behalf by liking and Sharing his videos, subscribing to this channel, and going pro at FireShip IO. Thanks for watching, and I will see you in the next one.
Dot
dot
files.
files
Set
set
up
up
or
or
restore
restore
a
a
fully
fully
customized
customized
development
development
environment
environment
by
by
maintaining
maintaining
a
a
repository
repository
of
of
text
text
based
based
config
config
files.
files
As
as
developers
developers
were
were
trained
trained
to
to
write
write
dry
dry
code,
code
do
do
not
not
repeat
repeat
yourself.
yourself
But
but
this
this
principle
principle
also
also
applies
applies
to
to
other
other
areas
areas
of
of
a
a
developer's
developer's
life,
life
like
like
the
the
configuration
configuration
of
of
a
a
development
development
environment.
environment
Imagine
imagine
this.
this
You
you
spent
spent
months
months
fine
fine
tuning
tuning
your
your
top
top
of
of
the
the
line
line
Intel
intel
Mac,
mac
but
but
now
now
need
need
to
to
throw
throw
it
it
in
in
the
the
garbage
garbage
because
because
the
the
new
new
Mac
mac
mini
mini
with
with
an
an
m
m
one
one
chip
chip
will
will
blow
blow
it
it
out
out
of
of
the
the
water.
water
Are
are
you
you
going
going
to
to
reinstall
reinstall
and
and
reconfigure
reconfigure
everything
everything
from
from
scratch?
scratch
Hopefully
hopefully
not.
not
Dot
dot
files
files
are
are
those
those
little
little
hidden
hidden
files
files
on
on
your
your
system
system
that
that
start
start
with
with
a
a
period,
period
like
like
bashprofile.env
bashprofile.env
or
or
git
git
config,
config
just
just
to
to
name
name
a
a
few.
few
With
with
a
a
repository
repository
of
of
these
these
files,
files
you
you
can
can
chronicle
chronicle
the
the
installation
installation
of
of
your
your
favorite
favorite
applications
applications
and
and
command
command
line
line
tools.
tools
Keep
keep
track
track
of
of
how
how
all
all
that
that
software
software
is
is
configured
configured
and
and
record
record
all
all
the
the
various
various
system
system
preferences
preferences
and
and
changes
changes
that
that
you've
you've
made
made
to
to
your
your
computer.
computer
These
these
files
files
already
already
live
live
on
on
your
your
system.
system
And
and
when
when
you
you
harness
harness
their
their
power,
power
you
you
can
can
replicate
replicate
your
your
perfect
perfect
development
development
environment
environment
on
on
a
a
new
new
computer
computer
in
in
a
a
completely
completely
hands
hands
off
off
and
and
automated
automated
way.
way
To
to
get
get
started,
started
you'll
you'll
want
want
to
to
organize
organize
all
all
of
of
your
your
configuration
configuration
files
files
in
in
a
a
git
git
repository.
repository
That
that
will
will
allow
allow
you
you
to
to
track
track
changes
changes
and
and
clone
clone
the
the
repo
repo
on
on
other
other
machines.
machines
Its
its
code
code
will
will
contain
contain
at
at
least
least
one
one
script
script
that
that
applies
applies
or
or
installs
installs
the
the
configurations
configurations
on
on
a
a
new
new
system,
system
and
and
that
that
means
means
weeks
weeks
of
of
hard
hard
manual
manual
labor
labor
can
can
be
be
reduced
reduced
down
down
to
to
a
a
git
git
clone
clone
followed
followed
by
by
an
an
install
install
script.
script
Maintaining
maintaining
your
your
own
own
dot
dot
files
files
repo
repo
will
will
help
help
you
you
develop
develop
discipline
discipline
for
for
other
other
important
important
skills
skills
from
from
command
command
line
line
use
use
to
to
git
git
to
to
the
the
organization
organization
and
and
inner
inner
workings
workings
of
of
your
your
machine.
machine
Wax
wax
on.
on
Wax
wax
off.
off
Read.
read
If
if
you're
you're
ready
ready
to
to
learn
learn
more
more
and
and
build
build
your
your
own
own
dot
dot
files
files
repo,
repo
Stay
stay
tuned.
tuned
Today,
today
we're
we're
going
going
beyond
beyond
100
100
seconds
seconds
with
with
special
special
guest,
guest
Patrick
patrick
McDonald.
mcdonald
He's
he's
the
the
instructor
instructor
of
of
a
a
full
full
dot
dot
files
files
course
course
and
and
will
will
teach
teach
you
you
how
how
to
to
set
set
up
up
your
your
own
own
dot
dot
Compose
compose
repo
repo
step
step
by
by
step,
step
taking
taking
your
your
developer
developer
productivity
productivity
to
to
the
the
next
next
level.
level
YouTube,
youtube
meet
meet
Patrick.
patrick
Over
over
the
the
last
last
20
20
plus
plus
years,
years
I've
i've
set
set
up
up
enough
enough
computers
computers
To
to
have
have
acquired
acquired
an
an
appreciation
appreciation
of
of
automating
automating
that
that
process,
process
and
and
I've
i've
gathered
gathered
a
a
few
few
tricks
tricks
I'd
i'd
like
like
to
to
share
share
with
with
you.
you
Hello,
hello
everyone.
everyone
I'm
i'm
Patrick,
patrick
and
and
I'll
i'll
be
be
your
your
guide
guide
as
as
we
we
go
go
beyond
beyond
100
100
seconds
seconds
to
to
learn
learn
how
how
to
to
back
back
up
up
a
a
few
few
typical
typical
dot
dot
files
files
Without
without
disturbing
disturbing
your
your
computer's
computer's
ability
ability
to
to
use
use
those
those
files
files
to
to
configure
configure
software.
software
If
if
you've
you've
never
never
heard
heard
of
of
dotfiles,
dotfiles
you're
you're
probably
probably
familiar
familiar
The
the
home
home
directory
directory
that
that
looks
looks
like
like
this.
this
But
but
as
as
Jeff
jeff
mentioned,
mentioned
macOS
macos
is
is
littered
littered
with
with
hidden
hidden
files.
files
Versus
versus
Code
code
is
is
open
open
to
to
the
the
same
same
home
home
directory
directory
And
and
its
its
file
file
explorer
explorer
shows
shows
several
several
more
more
items.
items
We
we
can
can
tell
tell
Finder
finder
to
to
show
show
the
the
same
same
hidden
hidden
files
files
by
by
entering
entering
the
the
key
key
combination
combination
command
command
shift
shift
period.
period
Most
most
hidden
hidden
files
files
have
have
a
a
dot
dot
prefix,
prefix
hence
hence
the
the
name
name
dot
dot
files.
files
They
they
can
can
be
be
folders
folders
as
as
well
well
as
as
files.
files
And
and
in
in
special
special
cases,
cases
they
they
can
can
be
be
hidden
hidden
by
by
the
the
operating
operating
system
system
even
even
though
though
they
they
are
are
missing
missing
the
the
dot.
dot
That's
that's
all
all
we
we
need
need
to
to
know
know
about
about
finder.
finder
So
so
let's
let's
look
look
at
at
v
v
s
s
code
code
where
where
we
we
can
can
see
see
that
that
our
our
system
system
uses
uses
dotfiles
dotfiles
in
in
our
our
home
home
directory,
directory
software
software
that
that
comes
comes
preinstalled
preinstalled
uses
uses
hidden
hidden
files
files
too,
too
And
and
so
so
does
does
the
the
custom
custom
software
software
that
that
we
we
install
install
on
on
our
our
own.
own
If
if
you've
you've
been
been
using
using
your
your
computer
computer
for
for
a
a
significant
significant
amount
amount
of
of
time,
time
you
you
likely
likely
have
have
many
many
more
more
dot
dot
files
files
here.
here
We
we
are
are
going
going
to
to
focus
focus
on
on
these
these
2
2
at
at
the
the
bottom,
bottom
git
git
config
config
and
and
zshrc.
zshrc
When
when
you
you
started
started
using
using
Git,
git
You
you
probably
probably
issued
issued
a
a
pair
pair
of
of
commands
commands
to
to
set
set
your
your
name
name
and
and
email
email
address.
address
Those
those
settings
settings
ended
ended
up
up
here
here
in
in
the
the
git
git
config
config
file.
file
As
as
you
you
continue
continue
learning
learning
and
and
using
using
Git,
git
this
this
file
file
can
can
grow
grow
with
with
more
more
configurations.
configurations
Before
before
we
we
move
move
on,
on
Let
let
me
me
recommend
recommend
using
using
the
the
no
no
reply
reply
email
email
address
address
available
available
with
with
your
your
GitHub
github
account.
account
When
when
you
you
publish
publish
your
your
dotfiles
dotfiles
repo
repo
for
for
the
the
world
world
to
to
see,
see
This
this
lets
lets
you
you
keep
keep
your
your
personal
personal
email
email
address
address
a
a
secret.
secret
Z
z
s
s
h
h
is
is
the
the
new
new
default
default
shell
shell
on
on
macOS,
macos
and
and
the
the
zshrc
zshrc
file
file
is
is
what
what
you
you
use
use
to
to
customize
customize
the
the
shell
shell
experience.
experience
So
so
far,
far
we
we
are
are
only
only
using
using
this
this
to
to
customize
customize
the
the
prompt.
prompt
But
but
like
like
we
we
saw
saw
with
with
the
the
git
git
config
config
file,
file
we
we
can
can
add
add
to
to
this
this
file
file
in
in
many
many
ways.
ways
We
we
already
already
have
have
2
2
files
files
that
that
are
are
going
going
to
to
change
change
over
over
time.
time
What
what
does
does
this
this
mean?
mean
Yes.
yes
It
it
means
means
we're
we're
going
going
to
to
need
need
a
a
Git
git
repository
repository
to
to
start
start
tracking
tracking
these
these
files
files
along
along
with
with
the
the
changes
changes
we
we
make
make
to
to
them.
them
Let's
let's
open
open
the
the
integrated
integrated
terminal
terminal
where
where
we
we
can
can
see
see
our
our
super
super
fancy
fancy
custom
custom
prompt
prompt
in
in
action
action
and
and
where
where
we
we
can
can
see
see
that
that
we
we
start
start
off
off
in
in
the
the
home
home
directory.
directory
I've
i've
already
already
set
set
up
up
a
a
repository
repository
on
on
GitHub,
github
so
so
I'll
i'll
start
start
a
a
git
git
clone
clone
command
command
and
and
paste
paste
in
in
the
the
SSH
ssh
URL.
url
Now
now
we
we
need
need
to
to
tell
tell
it
it
the
the
directory
directory
to
to
create.
create
And
and
since
since
everybody
everybody
else
else
is
is
doing
doing
it,
it
let's
let's
make
make
a
a
hidden
hidden
folder
folder
by
by
prefixing
prefixing
our
our
dot
dot
files
files
repo
repo
with
with
a
a
period.
period
Our
our
new
new
directory
directory
has
has
a
a
readme
readme
that
that
we
we
will
will
look
look
at
at
shortly,
shortly
but
but
let's
let's
start
start
by
by
moving
moving
these
these
2
2
dot
dot
files
files
into
into
the
the
repo
repo
so
so
we
we
can
can
back
back
them
them
up.
up
Of
of
course,
course
the
the
act
act
of
of
moving
moving
them
them
isn't
isn't
enough,
enough
and
and
these
these
two
two
files
files
are
are
still
still
untracked.
untracked
So
so
we
we
will
will
c
c
d
d
into
into
the
the
dotfiles
dotfiles
directory
directory
Where
where
we
we
can
can
add
add
the
the
2
2
files
files
to
to
the
the
repository,
repository
and
and
then
then
we
we
will
will
commit
commit
them.
them
But
but
is
is
this
this
all
all
we
we
have
have
to
to
do?
do
Will
will
we
we
be
be
done
done
after
after
entering
entering
this
this
command?
command
Let's
let's
try
try
it.
it
And
and
it
it
looks
looks
like
like
we
we
have
have
a
a
problem.
problem
Instead
instead
of
of
using
using
the
the
user
user
information
information
that
that
we
we
just
just
saw
saw
in
in
our
our
git
git
config,
config
The
the
output
output
says
says
that
that
Git
git
automatically
automatically
configured
configured
this
this
committer
committer
information
information
based
based
on
on
the
the
username
username
and
and
host
host
name.
name
Remember
remember
that
that
software
software
likes
likes
to
to
use
use
our
our
home
home
directory.
directory
So
so
by
by
moving
moving
this
this
file
file
to
to
a
a
different
different
location,
location
we've
we've
broken
broken
the
the
configuration.
configuration
Every
every
time
time
we
we
make
make
a
a
commit,
commit
Git
git
will
will
remind
remind
us
us
of
of
this
this
problem.
problem
Let's
let's
copy
copy
this
this
suggested
suggested
command
command
about
about
resetting
resetting
the
the
author
author
and
and
amending
amending
the
the
commit,
commit
And
and
we
we
will
will
try
try
to
to
fix
fix
this
this
in
in
a
a
few
few
minutes.
minutes
What
what
about
about
our
our
z
z
s
s
h
h
configurations?
configurations
I
i
think
think
we
we
can
can
assume
assume
that
that
these
these
are
are
broken
broken
as
as
well.
well
Keep
keep
an
an
eye
eye
on
on
the
the
file
file
explorer
explorer
to
to
the
the
left
left
as
as
I
i
kill
kill
this
this
terminal.
terminal
When
when
a
a
shell
shell
session
session
ends,
ends
its
its
command
command
history
history
is
is
written
written
out.
out
And
and
as
as
software
software
continues
continues
to
to
add
add
files
files
to
to
our
our
home
home
directory,
directory
we
we
have
have
to
to
decide
decide
whether
whether
to
to
move
move
these
these
files
files
to
to
our
our
repository.
repository
Z
z
s
s
h
h
history
history
is
is
not
not
the
the
type
type
of
of
file
file
we
we
want
want
to
to
track
track
in
in
our
our
repo.
repo
So
so
we
we
will
will
leave
leave
it
it
here
here
in
in
the
the
home
home
directory.
directory
We
we
just
just
saw
saw
that
that
zsh
zsh
writes
writes
to
to
our
our
home
home
directory,
directory
but
but
it
it
tries
tries
to
to
read
read
from
from
it
it
as
as
well.
well
If
if
we
we
open
open
a
a
new
new
shell,
shell
we
we
see
see
that
that
we've
we've
lost
lost
our
our
custom
custom
prompt
prompt
Because
because
zsh
zsh
could
could
not
not
find
find
the
the
zshrc
zshrc
file.
file
Instead,
instead
we
we
see
see
the
the
default
default
prompt,
prompt
which
which
happens
happens
to
to
have
have
a
a
similar
similar
default
default
to
to
the
the
one
one
we
we
just
just
saw
saw
for
for
git
git
Using
using
the
the
same
same
username
username
and
and
hostname
hostname
combination.
combination
How
how
do
do
we
we
fix
fix
these
these
broken
broken
configurations?
configurations
We
we
don't
don't
want
want
to
to
duplicate
duplicate
these
these
files,
files
Store
store
their
their
copies
copies
in
in
the
the
home
home
directory
directory
and
and
manually
manually
keep
keep
them
them
in
in
sync.
sync
Luckily,
luckily
there's
there's
a
a
way
way
that
that
a
a
file
file
can
can
be
be
in
in
2
2
places
places
at
at
the
the
same
same
time,
time
Which
which
is
is
called
called
a
a
symbolic
symbolic
link
link
or
or
symlink
symlink
for
for
short.
short
To
to
create
create
one,
one
we
we
will
will
use
use
the
the
l
l
m
m
or
or
link
link
command.
command
Then
then
we
we
will
will
add
add
the
the
s
s
option
option
which
which
stands
stands
for
for
symbolic
symbolic
link.
link
Now
now
we'll
we'll
pass
pass
in
in
the
the
full
full
path
path
to
to
the
the
real
real
file
file
in
in
our
our
dot
dot
files
files
directory.
directory
And
and
lastly,
lastly
we'll
we'll
pass
pass
in
in
the
the
path
path
to
to
the
the
original
original
location
location
where
where
the
the
zshrc
zshrc
file
file
is
is
expected
expected
to
to
live.
live
The
the
file
file
explorer
explorer
now
now
shows
shows
that
that
the
the
zshrc
zshrc
file
file
is
is
back
back
in
in
the
the
home
home
directory,
directory
but
but
it
it
has
has
an
an
arrow
arrow
to
to
the
the
right
right
which
which
signifies
signifies
that
that
this
this
is
is
a
a
Symlink.
symlink
If
if
that
that
arrow
arrow
does
does
not
not
show
show
up
up
for
for
you,
you
reload
reload
the
the
window
window
and
and
it
it
should
should
appear.
appear
Now
now
I'll
i'll
kill
kill
the
the
terminal
terminal
again
again
and
and
open
open
the
the
new
new
Symlink
symlink
version
version
from
from
the
the
home
home
directory
directory
To
to
the
the
right
right
of
of
the
the
zshrc
zshrc
file
file
in
in
our
our
dotfiles
dotfiles
directory,
directory
they
they
both
both
look
look
like
like
normal
normal
files,
files
don't
don't
they?
they
But
but
if
if
I
i
add
add
a
a
comment
comment
to
to
the
the
real
real
file
file
and
and
save
save
it,
it
We
we
can
can
see
see
that
that
changes
changes
to
to
the
the
real
real
file
file
at
at
the
the
left
left
will
will
show
show
up
up
in
in
the
the
Symlink
symlink
version
version
at
at
the
the
right.
right
Of
of
course,
course
we
we
can
can
delete
delete
these
these
lines
lines
from
from
the
the
right,
right
and
and
After
after
another
another
save,
save
those
those
changes
changes
are
are
reflected
reflected
at
at
the
the
left.
left
Since
since
Versus
versus
Code
code
can
can
follow
follow
the
the
SymLink
symlink
to
to
the
the
real
real
file
file
and
and
treat
treat
it
it
as
as
a
a
real
real
file,
file
I
i
bet
bet
zsh
zsh
can
can
too.
too
If
if
we
we
open
open
a
a
new
new
shell,
shell
we
we
see
see
our
our
custom
custom
prompt
prompt
has
has
returned.
returned
When
when
a
a
shell
shell
loads,
loads
It
it
looks
looks
for
for
the
the
zshrc
zshrc
file
file
in
in
the
the
home
home
directory,
directory
which
which
follows
follows
the
the
symlink
symlink
to
to
the
the
real
real
file,
file
and
and
the
the
customization
customization
makes
makes
it
it
into
into
the
the
shell.
shell
Not
not
only
only
did
did
the
the
shell
shell
load
load
the
the
zshrc
zshrc
file,
file
it
it
also
also
loaded
loaded
the
the
zsh
zsh
history
history
file,
file
which
which
is
is
still
still
in
in
the
the
home
home
directory.
directory
This
this
means
means
we
we
have
have
access
access
to
to
previous
previous
commands.
commands
I
i
can
can
press
press
up
up
to
to
retrieve
retrieve
the
the
most
most
recent
recent
command
command
from
from
the
the
history
history
And
and
then
then
alter
alter
it
it
to
to
create
create
a
a
SYMLink
symlink
for
for
the
the
git
git
config
config
file,
file
which
which
we
we
see
see
appear
appear
in
in
the
the
Explorer
explorer
with
with
another
another
arrow
arrow
icon.
icon
We've
we've
seen
seen
enough
enough
of
of
the
the
home
home
directory.
directory
So
so
before
before
testing
testing
our
our
git
git
config
config
fix,
fix
let's
let's
open
open
only
only
the
the
dotfiles
dotfiles
directory.
directory
The
the
key
key
combo
combo
we
we
used
used
in
in
finder
finder
to
to
show
show
hidden
hidden
files,
files
command
command
shift
shift
period,
period
works
works
here
here
as
as
well.
well
Of
of
course,
course
the
the
arrows
arrows
here
here
on
on
the
the
file
file
icons
icons
mean
mean
the
the
same
same
thing
thing
they
they
do
do
in
in
the
the
file
file
explorer.
explorer
After
after
opening
opening
the
the
dot
dot
files
files
directory,
directory
we
we
have
have
less
less
clutter
clutter
to
to
look
look
at.
at
Since
since
we
we
have
have
the
the
dot
dot
Files
files
directory
directory
open
open
in
in
Versus
versus
Code,
code
the
the
integrated
integrated
terminal
terminal
will
will
start
start
at
at
the
the
same
same
location
location
when
when
we
we
fire
fire
up
up
a
a
new
new
shell.
shell
A
a
git
git
log
log
command
command
will
will
remind
remind
us
us
that
that
our
our
last
last
commit
commit
has
has
the
the
wrong
wrong
author,
author
which
which
happened
happened
because
because
we
we
moved
moved
the
the
git
git
config
config
file.
file
We
we
can
can
check
check
to
to
see
see
if
if
our
our
second
second
symlink
symlink
is
is
working
working
by
by
checking
checking
the
the
global
global
git
git
config
config
for
for
the
the
email
email
address,
address
which
which
shows
shows
The
the
correct
correct
no
no
reply
reply
email
email
address
address
that
that
we
we
saw
saw
before.
before
Now
now
I'll
i'll
paste
paste
in
in
the
the
command
command
that
that
I
i
copied
copied
a
a
bit
bit
ago.
ago
If
if
you
you
issue
issue
this
this
command
command
as
as
is,
is
You'll
you'll
end
end
up
up
editing
editing
the
the
commit
commit
in
in
Vim
vim
because
because
it
it
is
is
the
the
default
default
editor.
editor
And
and
if
if
you're
you're
like
like
me,
me
it
it
will
will
take
take
you
you
half
half
an
an
hour
hour
to
to
figure
figure
out
out
how
how
to
to
exit
exit
Vim.
vim
Changing
changing
the
the
default
default
editor,
editor
perhaps
perhaps
to
to
nano
nano
or
or
Versus
versus
Code,
code
is
is
the
the
type
type
of
of
configuration
configuration
you
you
could
could
make
make
to
to
your
your
git
git
config
config
file,
file
and
and
the
the
change
change
would
would
be
be
tracked
tracked
in
in
your
your
repo.
repo
But
but
in
in
this
this
case,
case
we
we
don't
don't
actually
actually
want
want
to
to
edit
edit
the
the
contents
contents
of
of
the
the
commit,
commit
so
so
we
we
can
can
add
add
the
the
no
no
edit
edit
option.
option
Another
another
look
look
at
at
the
the
git
git
log
log
shows
shows
that
that
the
the
author
author
information
information
has
has
been
been
corrected.
corrected
We
we
have
have
successfully
successfully
backed
backed
up
up
our
our
configurations
configurations
while
while
preserving
preserving
the
the
ability
ability
to
to
use
use
them.
them
But
but
that
that
won't
won't
do
do
a
a
lot
lot
of
of
good
good
if
if
our
our
software
software
is
is
not
not
installed.
installed
We
we
need
need
an
an
automated
automated
way
way
of
of
installing
installing
software.
software
And
and
for
for
that,
that
we
we
will
will
use
use
a
a
package
package
manager
manager
called
called
Homebrew.
homebrew
It
it
just
just
so
so
happens
happens
that
that
I
i
used
used
Homebrew
homebrew
to
to
install
install
Versus
versus
Code
code
along
along
with
with
some
some
other
other
software.
software
We
we
don't
don't
have
have
time
time
to
to
learn
learn
much
much
about
about
it,
it
but
but
Homebrew
homebrew
keeps
keeps
track
track
of
of
what
what
it
it
has
has
installed
installed
and
and
can
can
output
output
a
a
list
list
of
of
software
software
with
with
this
this
command.
command
After
after
brew
brew
bundle
bundle
dump,
dump
I'll
i'll
add
add
the
the
describe
describe
option
option
for
for
a
a
little
little
more
more
info.
info
This
this
command
command
will
will
create
create
a
a
file
file
in
in
your
your
current
current
directory,
directory
so
so
it's
it's
important
important
that
that
we
we
are
are
Already
already
in
in
our
our
dotfiles
dotfiles
repo.
repo
Our
our
new
new
brew
brew
file
file
has
has
a
a
list
list
of
of
software
software
that
that
can
can
be
be
reinstalled
reinstalled
at
at
a
a
later
later
date.
date
TAPs
taps
are
are
the
the
repositories
repositories
where
where
Homebrew
homebrew
keeps
keeps
own
own
software,
software
along
along
with
with
the
the
information
information
about
about
the
the
other
other
software
software
it
it
can
can
install.
install
BRUs
brus
are
are
tools
tools
you
you
typically
typically
use
use
in
in
your
your
shell.
shell
These
these
top
top
2
2
are
are
new
new
tools
tools
I've
i've
added
added
to
to
improve
improve
my
my
shell
shell
experience,
experience
while
while
these
these
bottom
bottom
2
2
are
are
upgraded
upgraded
versions
versions
of
of
pre
pre
installed
installed
software.
software
So
so
Homebrew
homebrew
helps
helps
keep
keep
everything
everything
up
up
to
to
date,
date
and
and
the
the
casks
casks
at
at
the
the
bottom
bottom
are
are
full
full
blown
blown
applications
applications
that
that
you
you
probably
probably
recognize.
recognize
Let's
let's
start
start
one
one
last
last
shell,
shell
Add
add
the
the
brew
brew
file
file
to
to
start
start
tracking
tracking
it
it
and
and
do
do
another
another
commit.
commit
Note
note
that
that
this
this
time,
time
we
we
did
did
not
not
get
get
the
the
warning
warning
message
message
that
that
we
we
saw
saw
before
before
about
about
automatically
automatically
configuring
configuring
the
the
author.
author
That's
that's
another
another
sign
sign
that
that
our
our
git
git
config
config
sem
sem
link
link
is
is
working,
working
so
so
we
we
will
will
push
push
our
our
changes
changes
to
to
the
the
remote
remote
repository.
repository
Now
now
we've
we've
saved
saved
our
our
software
software
along
along
with
with
some
some
configurations,
configurations
but
but
we
we
haven't
haven't
recorded
recorded
the
the
process.
process
When
when
the
the
time
time
comes
comes
to
to
bootstrap
bootstrap
a
a
new
new
computer
computer
using
using
our
our
dot
dot
files
files
repository,
repository
we
we
are
are
likely
likely
to
to
forget
forget
some
some
steps.
steps
Instead
instead
of
of
researching
researching
and
and
relearning
relearning
these
these
things,
things
we
we
can
can
keep
keep
a
a
list
list
in
in
the
the
readme.
readme
We
we
haven't
haven't
seen
seen
this
this
first
first
step
step
yet.
yet
Before
before
we
we
can
can
use
use
git
git
and
and
homebrew,
homebrew
we
we
would
would
need
need
to
to
install
install
the
the
command
command
line
line
tools.
tools
After
after
that,
that
we
we
would
would
clone
clone
the
the
repository
repository
to
to
our
our
new
new
machine.
machine
SSH
ssh
is
is
preferred,
preferred
but
but
you
you
might
might
want
want
to
to
start
start
with
with
h
h
t
t
t
t
p
p
s
s
and
and
switch
switch
remotes
remotes
After
after
you've
you've
had
had
a
a
chance
chance
to
to
set
set
up
up
SSH
ssh
with
with
our
our
configuration
configuration
files
files
on
on
our
our
machine,
machine
we
we
would
would
then
then
repeat
repeat
our
our
sim
sim
linking
linking
steps.
steps
You
you
can
can
probably
probably
see
see
that
that
this
this
would
would
be
be
unwieldy
unwieldy
if
if
we
we
had
had
a
a
dozen
dozen
symlinks.
symlinks
And
and
the
the
more
more
manual
manual
steps
steps
we
we
have,
have
the
the
more
more
error
error
prone
prone
our
our
process.
process
There
there
are
are
better
better
ways
ways
to
to
do
do
this,
this
and
and
this
this
is
is
the
the
type
type
of
of
thing
thing
you'd
you'd
eventually
eventually
work
work
into
into
an
an
install
install
script.
script
Finally,
finally
we
we
would
would
install
install
Homebrew
homebrew
And
and
then
then
point
point
it
it
to
to
our
our
brew
brew
file
file
to
to
reinstall
reinstall
all
all
of
of
our
our
software.
software
I
i
really
really
wish
wish
we
we
had
had
the
the
time
time
to
to
see
see
this
this
step
step
in
in
action
action
because
because
it
it
is
is
very
very
satisfying.
satisfying
Just
just
like
like
we
we
saw
saw
in
in
the
the
git
git
config
config
and
and
the
the
zshrc
zshrc
files,
files
here
here
we
we
have
have
another
another
list
list
of
of
ideas
ideas
regarding
regarding
improving
improving
our
our
dotfiles
dotfiles
process.
process
We
we
haven't
haven't
looked
looked
at
at
saving
saving
system
system
preferences,
preferences
organizing
organizing
this
this
repo
repo
into
into
separate
separate
files,
files
building
building
that
that
install
install
script,
script
Or
or
automating
automating
any
any
of
of
the
the
steps
steps
we
we
did.
did
There
there
are
are
110000000
110000000
possibilities
possibilities
which
which
we
we
can't
can't
cover
cover
in
in
10
10
minutes,
minutes
let
let
alone
alone
100
100
seconds.
seconds
But
but
as
as
Jeff
jeff
mentioned,
mentioned
I
i
have
have
a
a
growing
growing
course
course
that
that
thoroughly
thoroughly
covers
covers
this
this
material.
material
And
and
for
for
the
the
next
next
30
30
days,
days
I'll
i'll
keep
keep
The
the
price
price
is
is
low
low
as
as
the
the
course
course
platform
platform
allows.
allows
Enroll
enroll
now
now
and
and
your
your
next
next
computer
computer
setup
setup
will
will
be
be
no
no
match
match
for
for
your
your
dot
dot
file
file
skills.
skills
Thank
thank
you
you
for
for
watching.
watching
And
and
since
since
there's
there's
no
no
way
way
I
i
could
could
possibly
possibly
thank
thank
Jeff
jeff
enough
enough
for
for
sharing
sharing
his
his
stage
stage
with
with
me,
me
please
please
thank
thank
him
him
on
on
my
my
behalf
behalf
by
by
liking
liking
and
and
Sharing
sharing
his
his
videos,
videos
subscribing
subscribing
to
to
this
this
channel,
channel
and
and
going
going
pro
pro
at
at
FireShip
fireship
IO.
io
Thanks
thanks
for
for
watching,
watching
and
and
I
i
will
will
see
see
you
you
in
in
the
the
next
next
one.
one
success
The speakers discuss maintaining a fully customized development environment by maintaining a repository of text-based config files, using dot files to organize configuration files and record system preferences and changes, and the instructor of a full dot files course. They also introduce instructor Jeff and explain how to set up a Git repository and back up files. The command line is used to set up a commit and find files, and the importance of fixing broken configurations and fixing broken commands is emphasized. The speakers also discuss the use of l m or link command to add the s option and add the s option to a file directory, and explain how to use the command line tools and the possibility of installing the command line on a machine.
~/.dotfiles in 100 Seconds
Dot files. Set up or restore a fully customized development environment by maintaining a repository of text based config files. As developers were trained to write dry code, do not repeat yourself. But this principle also applies to other areas of a developer's life, like the configuration of a development environment. Imagine this. You spent months fine tuning your top of the line Intel Mac, but now need to throw it in the garbage because the new Mac mini with an m one chip will blow it out of the water. Are you going to reinstall and reconfigure everything from scratch? Hopefully not. Dot files are those little hidden files on your system that start with a period, like bashprofile.env or git config, just to name a few. With a repository of these files, you can chronicle the installation of your favorite applications and command line tools. Keep track of how all that software is configured and record all the various system preferences and changes that you've made to your computer. These files already live on your system. And when you harness their power, you can replicate your perfect development environment on a new computer in a completely hands off and automated way. To get started, you'll want to organize all of your configuration files in a git repository. That will allow you to track changes and clone the repo on other machines. Its code will contain at least one script that applies or installs the configurations on a new system, and that means weeks of hard manual labor can be reduced down to a git clone followed by an install script. Maintaining your own dot files repo will help you develop discipline for other important skills from command line use to git to the organization and inner workings of your machine. Wax on. Wax off. Read. If you're ready to learn more and build your own dot files repo, Stay tuned. Today, we're going beyond 100 seconds with special guest, Patrick McDonald. He's the instructor of a full dot files course and will teach you how to set up your own dot Compose repo step by step, taking your developer productivity to the next level. YouTube, meet Patrick. Over the last 20 plus years, I've set up enough computers To have acquired an appreciation of automating that process, and I've gathered a few tricks I'd like to share with you. Hello, everyone. I'm Patrick, and I'll be your guide as we go beyond 100 seconds to learn how to back up a few typical dot files Without disturbing your computer's ability to use those files to configure software. If you've never heard of dotfiles, you're probably familiar The home directory that looks like this. But as Jeff mentioned, macOS is littered with hidden files. Versus Code is open to the same home directory And its file explorer shows several more items. We can tell Finder to show the same hidden files by entering the key combination command shift period. Most hidden files have a dot prefix, hence the name dot files. They can be folders as well as files. And in special cases, they can be hidden by the operating system even though they are missing the dot. That's all we need to know about finder. So let's look at v s code where we can see that our system uses dotfiles in our home directory, software that comes preinstalled uses hidden files too, And so does the custom software that we install on our own. If you've been using your computer for a significant amount of time, you likely have many more dot files here. We are going to focus on these 2 at the bottom, git config and zshrc. When you started using Git, You probably issued a pair of commands to set your name and email address. Those settings ended up here in the git config file. As you continue learning and using Git, this file can grow with more configurations. Before we move on, Let me recommend using the no reply email address available with your GitHub account. When you publish your dotfiles repo for the world to see, This lets you keep your personal email address a secret. Z s h is the new default shell on macOS, and the zshrc file is what you use to customize the shell experience. So far, we are only using this to customize the prompt. But like we saw with the git config file, we can add to this file in many ways. We already have 2 files that are going to change over time. What does this mean? Yes. It means we're going to need a Git repository to start tracking these files along with the changes we make to them. Let's open the integrated terminal where we can see our super fancy custom prompt in action and where we can see that we start off in the home directory. I've already set up a repository on GitHub, so I'll start a git clone command and paste in the SSH URL. Now we need to tell it the directory to create. And since everybody else is doing it, let's make a hidden folder by prefixing our dot files repo with a period. Our new directory has a readme that we will look at shortly, but let's start by moving these 2 dot files into the repo so we can back them up. Of course, the act of moving them isn't enough, and these two files are still untracked. So we will c d into the dotfiles directory Where we can add the 2 files to the repository, and then we will commit them. But is this all we have to do? Will we be done after entering this command? Let's try it. And it looks like we have a problem. Instead of using the user information that we just saw in our git config, The output says that Git automatically configured this committer information based on the username and host name. Remember that software likes to use our home directory. So by moving this file to a different location, we've broken the configuration. Every time we make a commit, Git will remind us of this problem. Let's copy this suggested command about resetting the author and amending the commit, And we will try to fix this in a few minutes. What about our z s h configurations? I think we can assume that these are broken as well. Keep an eye on the file explorer to the left as I kill this terminal. When a shell session ends, its command history is written out. And as software continues to add files to our home directory, we have to decide whether to move these files to our repository. Z s h history is not the type of file we want to track in our repo. So we will leave it here in the home directory. We just saw that zsh writes to our home directory, but it tries to read from it as well. If we open a new shell, we see that we've lost our custom prompt Because zsh could not find the zshrc file. Instead, we see the default prompt, which happens to have a similar default to the one we just saw for git Using the same username and hostname combination. How do we fix these broken configurations? We don't want to duplicate these files, Store their copies in the home directory and manually keep them in sync. Luckily, there's a way that a file can be in 2 places at the same time, Which is called a symbolic link or symlink for short. To create one, we will use the l m or link command. Then we will add the s option which stands for symbolic link. Now we'll pass in the full path to the real file in our dot files directory. And lastly, we'll pass in the path to the original location where the zshrc file is expected to live. The file explorer now shows that the zshrc file is back in the home directory, but it has an arrow to the right which signifies that this is a Symlink. If that arrow does not show up for you, reload the window and it should appear. Now I'll kill the terminal again and open the new Symlink version from the home directory To the right of the zshrc file in our dotfiles directory, they both look like normal files, don't they? But if I add a comment to the real file and save it, We can see that changes to the real file at the left will show up in the Symlink version at the right. Of course, we can delete these lines from the right, and After another save, those changes are reflected at the left. Since Versus Code can follow the SymLink to the real file and treat it as a real file, I bet zsh can too. If we open a new shell, we see our custom prompt has returned. When a shell loads, It looks for the zshrc file in the home directory, which follows the symlink to the real file, and the customization makes it into the shell. Not only did the shell load the zshrc file, it also loaded the zsh history file, which is still in the home directory. This means we have access to previous commands. I can press up to retrieve the most recent command from the history And then alter it to create a SYMLink for the git config file, which we see appear in the Explorer with another arrow icon. We've seen enough of the home directory. So before testing our git config fix, let's open only the dotfiles directory. The key combo we used in finder to show hidden files, command shift period, works here as well. Of course, the arrows here on the file icons mean the same thing they do in the file explorer. After opening the dot files directory, we have less clutter to look at. Since we have the dot Files directory open in Versus Code, the integrated terminal will start at the same location when we fire up a new shell. A git log command will remind us that our last commit has the wrong author, which happened because we moved the git config file. We can check to see if our second symlink is working by checking the global git config for the email address, which shows The correct no reply email address that we saw before. Now I'll paste in the command that I copied a bit ago. If you issue this command as is, You'll end up editing the commit in Vim because it is the default editor. And if you're like me, it will take you half an hour to figure out how to exit Vim. Changing the default editor, perhaps to nano or Versus Code, is the type of configuration you could make to your git config file, and the change would be tracked in your repo. But in this case, we don't actually want to edit the contents of the commit, so we can add the no edit option. Another look at the git log shows that the author information has been corrected. We have successfully backed up our configurations while preserving the ability to use them. But that won't do a lot of good if our software is not installed. We need an automated way of installing software. And for that, we will use a package manager called Homebrew. It just so happens that I used Homebrew to install Versus Code along with some other software. We don't have time to learn much about it, but Homebrew keeps track of what it has installed and can output a list of software with this command. After brew bundle dump, I'll add the describe option for a little more info. This command will create a file in your current directory, so it's important that we are Already in our dotfiles repo. Our new brew file has a list of software that can be reinstalled at a later date. TAPs are the repositories where Homebrew keeps own software, along with the information about the other software it can install. BRUs are tools you typically use in your shell. These top 2 are new tools I've added to improve my shell experience, while these bottom 2 are upgraded versions of pre installed software. So Homebrew helps keep everything up to date, and the casks at the bottom are full blown applications that you probably recognize. Let's start one last shell, Add the brew file to start tracking it and do another commit. Note that this time, we did not get the warning message that we saw before about automatically configuring the author. That's another sign that our git config sem link is working, so we will push our changes to the remote repository. Now we've saved our software along with some configurations, but we haven't recorded the process. When the time comes to bootstrap a new computer using our dot files repository, we are likely to forget some steps. Instead of researching and relearning these things, we can keep a list in the readme. We haven't seen this first step yet. Before we can use git and homebrew, we would need to install the command line tools. After that, we would clone the repository to our new machine. SSH is preferred, but you might want to start with h t t p s and switch remotes After you've had a chance to set up SSH with our configuration files on our machine, we would then repeat our sim linking steps. You can probably see that this would be unwieldy if we had a dozen symlinks. And the more manual steps we have, the more error prone our process. There are better ways to do this, and this is the type of thing you'd eventually work into an install script. Finally, we would install Homebrew And then point it to our brew file to reinstall all of our software. I really wish we had the time to see this step in action because it is very satisfying. Just like we saw in the git config and the zshrc files, here we have another list of ideas regarding improving our dotfiles process. We haven't looked at saving system preferences, organizing this repo into separate files, building that install script, Or automating any of the steps we did. There are 110000000 possibilities which we can't cover in 10 minutes, let alone 100 seconds. But as Jeff mentioned, I have a growing course that thoroughly covers this material. And for the next 30 days, I'll keep The price is low as the course platform allows. Enroll now and your next computer setup will be no match for your dot file skills. Thank you for watching. And since there's no way I could possibly thank Jeff enough for sharing his stage with me, please thank him on my behalf by liking and Sharing his videos, subscribing to this channel, and going pro at FireShip IO. Thanks for watching, and I will see you in the next one.
The speakers discuss maintaining a fully customized development environment by maintaining a repository of text-based config files, using dot files to organize configuration files and record system preferences and changes, and the instructor of a full dot files course. They also introduce instructor Jeff and explain how to set up a Git repository and back up files. The command line is used to set up a commit and find files, and the importance of fixing broken configurations and fixing broken commands is emphasized. The speakers also discuss the use of l m or link command to add the s option and add the s option to a file directory, and explain how to use the command line tools and the possibility of installing the command line on a machine.

        [INST]
        You are youtuber called Fireship you make engaging high-intensity and entertaining coding tutorials and tech news. 
        you covers a wide range of topics relevant to programmers, aiming to help them learn and improve their skills quickly.
        
        Given the title of the video : ~/.dotfiles in 100 Seconds 
        and a small summary : The speakers discuss maintaining a fully customized development environment by maintaining a repository of text-based config files, using dot files to organize configuration files and record system preferences and changes, and the instructor of a full dot files course. They also introduce instructor Jeff and explain how to set up a Git repository and back up files. The command line is used to set up a commit and find files, and the importance of fixing broken configurations and fixing broken commands is emphasized. The speakers also discuss the use of l m or link command to add the s option and add the s option to a file directory, and explain how to use the command line tools and the possibility of installing the command line on a machine.
        [/INST]
        
        Generate the video : Dot files. Set up or restore a fully customized development environment by maintaining a repository of text based config files. As developers were trained to write dry code, do not repeat yourself. But this principle also applies to other areas of a developer's life, like the configuration of a development environment. Imagine this. You spent months fine tuning your top of the line Intel Mac, but now need to throw it in the garbage because the new Mac mini with an m one chip will blow it out of the water. Are you going to reinstall and reconfigure everything from scratch? Hopefully not. Dot files are those little hidden files on your system that start with a period, like bashprofile.env or git config, just to name a few. With a repository of these files, you can chronicle the installation of your favorite applications and command line tools. Keep track of how all that software is configured and record all the various system preferences and changes that you've made to your computer. These files already live on your system. And when you harness their power, you can replicate your perfect development environment on a new computer in a completely hands off and automated way. To get started, you'll want to organize all of your configuration files in a git repository. That will allow you to track changes and clone the repo on other machines. Its code will contain at least one script that applies or installs the configurations on a new system, and that means weeks of hard manual labor can be reduced down to a git clone followed by an install script. Maintaining your own dot files repo will help you develop discipline for other important skills from command line use to git to the organization and inner workings of your machine. Wax on. Wax off. Read. If you're ready to learn more and build your own dot files repo, Stay tuned. Today, we're going beyond 100 seconds with special guest, Patrick McDonald. He's the instructor of a full dot files course and will teach you how to set up your own dot Compose repo step by step, taking your developer productivity to the next level. YouTube, meet Patrick. Over the last 20 plus years, I've set up enough computers To have acquired an appreciation of automating that process, and I've gathered a few tricks I'd like to share with you. Hello, everyone. I'm Patrick, and I'll be your guide as we go beyond 100 seconds to learn how to back up a few typical dot files Without disturbing your computer's ability to use those files to configure software. If you've never heard of dotfiles, you're probably familiar The home directory that looks like this. But as Jeff mentioned, macOS is littered with hidden files. Versus Code is open to the same home directory And its file explorer shows several more items. We can tell Finder to show the same hidden files by entering the key combination command shift period. Most hidden files have a dot prefix, hence the name dot files. They can be folders as well as files. And in special cases, they can be hidden by the operating system even though they are missing the dot. That's all we need to know about finder. So let's look at v s code where we can see that our system uses dotfiles in our home directory, software that comes preinstalled uses hidden files too, And so does the custom software that we install on our own. If you've been using your computer for a significant amount of time, you likely have many more dot files here. We are going to focus on these 2 at the bottom, git config and zshrc. When you started using Git, You probably issued a pair of commands to set your name and email address. Those settings ended up here in the git config file. As you continue learning and using Git, this file can grow with more configurations. Before we move on, Let me recommend using the no reply email address available with your GitHub account. When you publish your dotfiles repo for the world to see, This lets you keep your personal email address a secret. Z s h is the new default shell on macOS, and the zshrc file is what you use to customize the shell experience. So far, we are only using this to customize the prompt. But like we saw with the git config file, we can add to this file in many ways. We already have 2 files that are going to change over time. What does this mean? Yes. It means we're going to need a Git repository to start tracking these files along with the changes we make to them. Let's open the integrated terminal where we can see our super fancy custom prompt in action and where we can see that we start off in the home directory. I've already set up a repository on GitHub, so I'll start a git clone command and paste in the SSH URL. Now we need to tell it the directory to create. And since everybody else is doing it, let's make a hidden folder by prefixing our dot files repo with a period. Our new directory has a readme that we will look at shortly, but let's start by moving these 2 dot files into the repo so we can back them up. Of course, the act of moving them isn't enough, and these two files are still untracked. So we will c d into the dotfiles directory Where we can add the 2 files to the repository, and then we will commit them. But is this all we have to do? Will we be done after entering this command? Let's try it. And it looks like we have a problem. Instead of using the user information that we just saw in our git config, The output says that Git automatically configured this committer information based on the username and host name. Remember that software likes to use our home directory. So by moving this file to a different location, we've broken the configuration. Every time we make a commit, Git will remind us of this problem. Let's copy this suggested command about resetting the author and amending the commit, And we will try to fix this in a few minutes. What about our z s h configurations? I think we can assume that these are broken as well. Keep an eye on the file explorer to the left as I kill this terminal. When a shell session ends, its command history is written out. And as software continues to add files to our home directory, we have to decide whether to move these files to our repository. Z s h history is not the type of file we want to track in our repo. So we will leave it here in the home directory. We just saw that zsh writes to our home directory, but it tries to read from it as well. If we open a new shell, we see that we've lost our custom prompt Because zsh could not find the zshrc file. Instead, we see the default prompt, which happens to have a similar default to the one we just saw for git Using the same username and hostname combination. How do we fix these broken configurations? We don't want to duplicate these files, Store their copies in the home directory and manually keep them in sync. Luckily, there's a way that a file can be in 2 places at the same time, Which is called a symbolic link or symlink for short. To create one, we will use the l m or link command. Then we will add the s option which stands for symbolic link. Now we'll pass in the full path to the real file in our dot files directory. And lastly, we'll pass in the path to the original location where the zshrc file is expected to live. The file explorer now shows that the zshrc file is back in the home directory, but it has an arrow to the right which signifies that this is a Symlink. If that arrow does not show up for you, reload the window and it should appear. Now I'll kill the terminal again and open the new Symlink version from the home directory To the right of the zshrc file in our dotfiles directory, they both look like normal files, don't they? But if I add a comment to the real file and save it, We can see that changes to the real file at the left will show up in the Symlink version at the right. Of course, we can delete these lines from the right, and After another save, those changes are reflected at the left. Since Versus Code can follow the SymLink to the real file and treat it as a real file, I bet zsh can too. If we open a new shell, we see our custom prompt has returned. When a shell loads, It looks for the zshrc file in the home directory, which follows the symlink to the real file, and the customization makes it into the shell. Not only did the shell load the zshrc file, it also loaded the zsh history file, which is still in the home directory. This means we have access to previous commands. I can press up to retrieve the most recent command from the history And then alter it to create a SYMLink for the git config file, which we see appear in the Explorer with another arrow icon. We've seen enough of the home directory. So before testing our git config fix, let's open only the dotfiles directory. The key combo we used in finder to show hidden files, command shift period, works here as well. Of course, the arrows here on the file icons mean the same thing they do in the file explorer. After opening the dot files directory, we have less clutter to look at. Since we have the dot Files directory open in Versus Code, the integrated terminal will start at the same location when we fire up a new shell. A git log command will remind us that our last commit has the wrong author, which happened because we moved the git config file. We can check to see if our second symlink is working by checking the global git config for the email address, which shows The correct no reply email address that we saw before. Now I'll paste in the command that I copied a bit ago. If you issue this command as is, You'll end up editing the commit in Vim because it is the default editor. And if you're like me, it will take you half an hour to figure out how to exit Vim. Changing the default editor, perhaps to nano or Versus Code, is the type of configuration you could make to your git config file, and the change would be tracked in your repo. But in this case, we don't actually want to edit the contents of the commit, so we can add the no edit option. Another look at the git log shows that the author information has been corrected. We have successfully backed up our configurations while preserving the ability to use them. But that won't do a lot of good if our software is not installed. We need an automated way of installing software. And for that, we will use a package manager called Homebrew. It just so happens that I used Homebrew to install Versus Code along with some other software. We don't have time to learn much about it, but Homebrew keeps track of what it has installed and can output a list of software with this command. After brew bundle dump, I'll add the describe option for a little more info. This command will create a file in your current directory, so it's important that we are Already in our dotfiles repo. Our new brew file has a list of software that can be reinstalled at a later date. TAPs are the repositories where Homebrew keeps own software, along with the information about the other software it can install. BRUs are tools you typically use in your shell. These top 2 are new tools I've added to improve my shell experience, while these bottom 2 are upgraded versions of pre installed software. So Homebrew helps keep everything up to date, and the casks at the bottom are full blown applications that you probably recognize. Let's start one last shell, Add the brew file to start tracking it and do another commit. Note that this time, we did not get the warning message that we saw before about automatically configuring the author. That's another sign that our git config sem link is working, so we will push our changes to the remote repository. Now we've saved our software along with some configurations, but we haven't recorded the process. When the time comes to bootstrap a new computer using our dot files repository, we are likely to forget some steps. Instead of researching and relearning these things, we can keep a list in the readme. We haven't seen this first step yet. Before we can use git and homebrew, we would need to install the command line tools. After that, we would clone the repository to our new machine. SSH is preferred, but you might want to start with h t t p s and switch remotes After you've had a chance to set up SSH with our configuration files on our machine, we would then repeat our sim linking steps. You can probably see that this would be unwieldy if we had a dozen symlinks. And the more manual steps we have, the more error prone our process. There are better ways to do this, and this is the type of thing you'd eventually work into an install script. Finally, we would install Homebrew And then point it to our brew file to reinstall all of our software. I really wish we had the time to see this step in action because it is very satisfying. Just like we saw in the git config and the zshrc files, here we have another list of ideas regarding improving our dotfiles process. We haven't looked at saving system preferences, organizing this repo into separate files, building that install script, Or automating any of the steps we did. There are 110000000 possibilities which we can't cover in 10 minutes, let alone 100 seconds. But as Jeff mentioned, I have a growing course that thoroughly covers this material. And for the next 30 days, I'll keep The price is low as the course platform allows. Enroll now and your next computer setup will be no match for your dot file skills. Thank you for watching. And since there's no way I could possibly thank Jeff enough for sharing his stage with me, please thank him on my behalf by liking and Sharing his videos, subscribing to this channel, and going pro at FireShip IO. Thanks for watching, and I will see you in the next one.
        