Skip to content

lab 1 Setup

Goals

Setup Name and Email

If you have never used git before, you need to do some setup first. Run the following commands to set your default name and email for all commits. If you have git already setup, you can skip down to the line ending section.

Execute:

git config --global user.name "Your Name"
git config --global user.email "your_email@whatever.com"

Note: Sometimes you will need to override the default name and email for specific projects. For example, it is not uncommon for client’s to provide us with an email to use when committing to their codebase. In this case, you can run the above commands inside the repository without using the --global option. This will set your name and email for that repository only.

Setup Line Ending Preferences

Also, for Unix/Mac users:

Execute:

git config --global core.autocrlf input
git config --global core.safecrlf true

And for Windows users:

Execute:

git config --global core.autocrlf true
git config --global core.safecrlf true

Setup the Default Branch Name

When you initialize a new project using git it creates an initial branch with a default name of master. You’ll learn more about these branches in future labs, but right now we’ll override that default name to be main instead. This align’s with GitHub’s current defaults and will make it easier to interact with your future projects there. See GitHub’s article for more information.

Execute:

git config --global init.defaultBranch main

Setup Ruby

For this tutorial you need a working Ruby interpreter. If you havenĀ“t one installed yet, it is time to set it up now:

https://www.ruby-lang.org/en/installation/