First, check whether git is already installed on your system. To do this, start a command window (on Windows) or a terminal (on Mac or Linux) and type
If git is installed, the return message will tell you which version it is; if it is not installed, you will see an error message.
Otherwise, follow the instructions for your operating system.
You can leave the majority of git's configuration settings with their default values. However, there are two settings that you may need to change globally. The first is your identity - this is important if you are going to collaborate with other people because it lets them know that it was you who made a particular change to a piece of code. You should use a name that clearly identifies you and cannot be mistaken for someone else. If the team you are working in has any kind of naming convention, find out what it is now and follow it. If your name was John Doe, you could use the following commands to set your identity:
The second setting you might want to change is your default editor. On Mac and Linux, there is a default editor set at the operating system level and git will use it. If you want to use something other than the OS default (emacs, for example), you can change it with the following command:
On Windows, you would need to use the full path to the editor executable in the git configuration command. For example, if you wanted to use Notepad++, you could specify your preference with the command below. Note that any other optional parameters can also be specified.
You can check your current git configuration by typing:
The majority of the git functions we need can be called from within PyCharm. If you want to know more about using git outside of PyCharm, please see the instructions on the git website.