There’s a lot to Git and there’s tons of information all over the web about it. There’s so much information out there that you might feel overwhelmed when you first start trying to learn what Git is and how to use it. The purpose of this blog article is to help you install Git, teach you a few basics, and point you in the right direction to learn more.
I’ll start with a little background information: Back in 2009 when I started blogging on this site, I used the TechNet script repository to share my PowerShell code that I wrote about in my blog articles. Then in 2014, I started using GitHub instead of the TechNet script repository to accomplish the same sort of thing. I primarily used both as a way to share my code. I really wasn’t taking advantage of the source control features in GitHub other than using it as a way to get back to a previous major version. I would develop my scripts outside of what GitHub was aware of, placing the finished product in the default master branch that GitHub created, create a commit, and sync those changes to the online repository. Needless to say it was a haphazard process especially when trying to collaborate with others.
So I decided to start learning Git which is what GitHub is built on. I know there are PowerShell cmdlets for Git, but I felt that learning pure Git would give me a better understanding and then I could learn the PowerShell cmdlets for it.
The first resource that you need to know about is the home page for Git. From there you can download Git for Windows or for other operating systems that you plan to run it on. The install is a clicker-size (even the click-next admin can install it). You’re safe taking all the default options during the install.
While I won’t get bogged down in the details, these particular options have to do with sharing your code with people running different operating systems. Take the defaults and move on:
I’ve launched Git Bash. There’s also Git CMD if you feel more comfortable with it, although all of the examples I’ll show in this blog article use Git Bash (on Windows).
Coming from a PowerShell background, the first thing I wanted to know was how to use Git’s help system. Typing git help shows some basic help information. Typing git help help opens more detailed help information in a webpage.