Setting Up Git
This tutorial is based heavily on the one from GitHub
Git Download
-
download the latest version of git.
- If you download the windows version, you should also install git bash or a similar terminal to have a terminal to enter commands in.
-
If you would like to work using a GUI, download that now.
- I suggest either GitHub desktop or Tortoise Git. The git website also has a list of GUIs.
Git Installation (In Terminal)
-
Once git is installed, open your terminal (gitbash on windows)
-
Set your name for git on your computer with the following steps in the terminal:
- Type
git config --global user.name
followed by your name in quotes:- ex:
git config --global user.name "Nabeel Chowdhury"
- This sets the global user name for all commits to the name you enter. If you want to only set a local user name, use
--local
instead of--global
- ex:
- enter
git config --global user.name
and check the output to see if your name was entered correctly
- Type
-
Set your email for git using the following steps:
- Type
git config --global user.email
followed by the email you want to use in quotes.- ex:
git config --global user.email "nblchowdhury@gmail.com"
- ex:
- If you want to keep your email private and you have a GitHub account, you may want to use the no reply email provided to you under the email setting of your profile.
- Once again, if you want to set a local user email for a repository, use
--local
instead of--global
. - Check the output of entering
git config --global user.email
to see if the email you entered is outputted.
- Type
Setup Terminal Code Editor
By default, the editor in the terminal will be vim. You can change this by following the following instructions
- Type
git config --global core.editor
followed by the path to your editor of choice in quotes.- Note that some editors have shorter aliases that don’t need the full path. For example, for visual studio, you would only need to type
“code”
instead of the path to visual studio - You can also add flags after the path, but in the quotes to change how the editor opens. Refer to the linked website for examples of that.
- Note that some editors have shorter aliases that don’t need the full path. For example, for visual studio, you would only need to type