Now I'm going to walk you through the process of getting your workspace set
up on Windows.
There are also written instructions in the instructor's notes.
If you're using Mac or Linux you should skip to the next video.
First I'm going to configure git bash to use a white background.
If you prefer to use a dark background you can skip this step.
I'll click this icon, select Defaults and go to the Colors tab.
Then I'll set the screen background to white and the screen text to black.
Then I'll close and reopen Git Bash and the screen is white now.
Next I'm going to download two files that are needed for
the setup I showed you earlier.
One to enable tab completion, and one to enable the git features in the prompt.
The links to these files are in the instructor's notes.
To download each file, I'll visit the page,
right-click anywhere on the page, and select Save as.
I'll save the file to my Downloads directory.
Next, I'll use Git Bash to move the file to my home directory.
My home directory is where I start out when I open Git Bash.
Or I can move to it by typing cd ~ if I need to.
Now I'll use the command mv which stands for
move to move the file I just saved to my home directory.
Now the first argument is the file I want to move,
which is in my Downloads directory and it's named git-completion.bash.txt.
Now the .txt was created by the web browser, but I don't actually want that.
So I'll choose the name git-completion.bash as the new name.
And without specifying a directory it will automatically get saved to my
current directory.
Then I'll go through the same process to save the second file in
the instructor's notes as git-prompt.sh.
Next I'm going to create a file called .bash profile which
contains configuration for Git Bash.
I recommend using the configuration file that I used when filming this course.
To do this you can download the file called bash_profile_course in
the downloadables section.
Then use Git Bash to move the file from your Downloads directory or wherever you
downloaded it to, to your home directory and name it .bash_profile.
Don't forget the dot at the beginning of the name.
If you already have a bash profile, then don't run this command.
Instead you can copy and
paste the content from my bash profile into your existing one if you like.
I don't see any changes to my prompt yet and that's because I'll need to
close and reopen Git Bash before the changes take effect.
I'll do that at the end of the video.
In case you're curious about what's in this batch profile, or if you'd like to
pick and choose which lines to keep, I'll go through what each line does.
Don't worry if you don't understand how each line works though.
Even experienced UNIX programmers frequently copy and paste this kind of
thing from their friends, rather than writing it from scratch.
This first line loads one of the files you downloaded earlier, and
enables tab completion.
These lines define some colors, which will be used in your prompt.
This line loads the other file you downloaded earlier, and it's necessary
for the git related stuff, like commit IDs, to show up in your prompt.
This line makes it so that an asterisk will show up in your prompt if you
change something in a git repository.
And this line sets the prompt.
It will show your user name in purple, the commit you have checked out and
other git related stuff in green, and
the directory you're currently in followed by a dollar sign in blue.
Anything after that will be displayed in the default color.
If you're curious to learn more about how prompts work in bash,
check out the link in the instructor's notes.
But it's not necessary for the rest of this course.
Now I'll configure git to use Sublime as my editor for
things like commit messages.
You'll want to configure git to use whatever editor you like, but
the process should be similar.
First, I'll need to figure out where Sublime was installed.
For many people this is under C:\Program Files\Sublime Text 2.
And that's the case for me.
If it's not here, you might also try looking under C:\Program Files (x86).
Then I'll run the command git config --global core.editor followed
by the text editor that I want to use in double quotes.
For me, this is Sublime, and I'll need to specify the full path to Sublime.
But for now, I'm just going to type sublime as a placeholder,
followed by -n -w.
The -n means Sublime will open in a new window and
the -w means git will wait for you to close Sublime before trying to continue.
Now, I'm going to replace sublime with the full path to Sublime in single
quotes, starting with the directory you saw earlier, and
then I'll add sublimetext.exe.
I know you can't see the whole command here.
You can copy and paste it from the instructor's notes, although you'll have
to modify it if Sublime is installed in a different location for
you, or if you're using a text editor other than Sublime.
It's also a good idea to make sure you can launch your text editor from
within Git Bash.
I'll show how to do this for Sublime.
If you use another text editor,
I recommend you use Google to figure out how to launch it from within Git Bash.
I can already launch Sublime within Git Bash by typing the full path to it,
but I'd like to have a shortcut.
To create one I'm going to add a line to my bash profile using Sublime.
Now opening the bash profile is going to be a little tricky because anything with
a dot at the beginning of the name is a hidden file and
it won't show up in most file system explorers.
To get around that I'm going to temporarily rename the file to not
have a dot at the beginning of the name, then I'll change it back once I finish.
Then I'll open up Sublime and open the file.
I'll navigate to my home directory under Computer > C:\Users\cbuckey.
And then I'll select the bash_profile.
Then I'll add this line to create a command called subl,
which will open Sublime.
If you use Sublime, you can copy and
paste this line from the instructor's notes.
Although again you might need to modify it to be the location Sublime is
installed for you.
Note that this command also won't work until you close and reopen Git Bash.
Now that I'm done,
I'll rename the file to have a dot at the beginning of the name again.
If I didn't do this,
then this file won't automatically be loaded when Git Bash starts up.
Next, I'll run two more Git config commands that will come in
handy later this course.
I'm going to run them now so that all the configuration advice for
the course will be in one place.
You can copy and paste these commands from the instructor's notes.
Finally, I'll close Git Bash and reopen it.
Now, I can see that my prompt has changed.
And if I want to view my bash profile using Sublime,
I can run subl .bash_profile.
Remember to close and
reopen Git Bash when you're finished or your changes won't take effect.