Git is really not that difficult. I am the first to admit that. There a just strings of characters forming commands after all, right? Everything should work just fine unless somehow you do not have it configured correctly. Well that is the problem!
Several times I have been referred back to the Git documentation by well-meaning techies claiming that it is “helpful”,“well-written” and “clear”. Well I have to say that it is simply is not any of those things or there would not be so many people having problems.
In my opinion everything in the Git Documentation is reasonably clear up until 1.6 Getting Started - First-Time Git Setup, which by the way is critical. From this point on, my comments will be in italics, the rest is copied and pasted directly from the the above-mentioned section.
First-Time Git Setup
Now that you have Git on your system, you’ll want to do a few things to customize your Git environment. You should have to do these things only once on any given computer; they’ll stick around between upgrades. You can also change them at any time by running through the commands again.
this implies that I should do something first, ie customize my Git environment. So far so good
Git comes with a tool called git config that lets you get and set configuration variables that control all aspects of how Git looks and operates. These variables can be stored in three different places:
- /etc/gitconfig file: Contains values applied to every user on the system and all their repositories. If you pass the option --system to git config, it reads and writes from this file specifically. (Because this is a system configuration file, you would need administrative or superuser privilege to make changes to it.)
- ~/.gitconfig or ~/.config/git/config file: Values specific personally to you, the user. You can make Git read and write to this file specifically by passing the --global option, and this affects all of the repositories you work with on your system.
- config file in the Git directory (that is, .git/config) of whatever repository you’re currently using: Specific to that single repository. You can force Git to read from and write to this file with the --local option, but that is in fact the default. (Unsurprisingly, you need to be located somewhere in a Git repository for this option to work properly.)
So using the tool git config is the how you set configuration variables and they are stored in the three above mentioned files. ok, intersting.
Each level overrides values in the previous level, so values in .git/config trump those in /etc/gitconfig.
ok got it
On Windows systems, Git looks for the .gitconfig file in the $HOME directory (C:\Users$USER for most people). It also still looks for /etc/gitconfig, although it’s relative to the MSys root, which is wherever you decide to install Git on your Windows system when you run the installer. If you are using version 2.x or later of Git for Windows, there is also a system-level config file at C:\Documents and Settings\All Users\Application Data\Git\config on Windows XP, and in C:\ProgramData\Git\config on Windows Vista and newer. This config file can only be changed by git config -f <file> as an admin.
for most people? i do not really care what most people do. I am reading this documentation at this point to do a first time set-up. And seeing from the previous page that in order to use git on windows I was going to need to install a ton of stuff to my computer, then STILL possibly have problems, I decided to use the github desktop app. So now what?
The first thing you should do when you install Git is to set your user name and email address. This is important because every Git commit uses this information, and it’s immutably baked into the commits you start creating:
$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]
Again, you need to do this only once if you pass the --global option, because then Git will always use that information for anything you do on that system. If you want to override this with a different name or email address for specific projects, you can run the command without the --global option when you’re in that project.
Many of the GUI tools will help you do this when you first run them.
So now that I am already confused with what you implied was the first step, customize my Git environment, they tell me that the first step is this easy-peasy command to set my user name and email. So which one is it?
I will not even bother with the rest of the page, since it matters so little with the very first steps being so unclear.
Please someone help to make sense of this. Thank you.