How to Install git on Windows ~ I Git Repo

Please share this post
Share

Welcome back, we’re building a website from scratch here at Seconds2 Work. This is Lesson 1.4 How to Install git on Windows. In this tutorial, you will get acquainted with Git and GitHub. You will discover how using a repository like GitHub can benefit you with projects version control. I will discuss what is Git, GitHub and version control. You will be using images along with step-by-step guidance to help you set up your Git and GitHub account.

You will get hands-on training setting up a Git repository and using the Git Bash command terminal window. When you finish this tutorial you’ll have beyond the basic knowledge of how Git and GitHub works. Even a beginner will walk away fully understanding how to use common and advanced techniques working with the Git software, and learn some of the jargon used.

 

!Warning { Mistakes Will Happen while Coding }

While you’re working on designing your website or coming up the latest app in PHP, C++, Angular or whatever languages you’re coding in, you’ll want to make sure you store your sources files in a secure location. You know, just in case something happens to them. Anything could happen to your work causing you to lose hours of dedicated craftsmanship. I have been learning about a place that offers such a location for collecting files in something called a repository, Git by GitHub.

 

How to Install git on Windows

 

What is Git?

Git is a distributed version control system VCS that’s open source, meaning it’s free and released under the GNU General Public License. This lesson will show you how to use Git for version control on your projects.

Git’s a version control system used for tracking changes in your source files. You download or clone it locally to your system and can work offline on your source code. No Internet connection is needed to work locally from your computer, only to push them to your repository.

You use Git to recall or roll back an older version of your source files from past dates and time. It tracks every thing you ever do to your files in your repository, also known as a repo. For example, you make changes to an element in your project, save it and go live with it. Sometime later, you decide to go back to the original version. You can do that, but wait there’s more…

Let’s say you’re a small business owner, you could make several version of your website and hold them in something like a Github depository, with each having a different look and function for business operations. Look at it this way, you can build a website and spend more time keeping it visually appealing to your visitors, then you do severing them.

With version control, you could in a way just flip a switch and be ready for the season. Version control can handle the holiday seasons, a setup for back-to-school season, and how about one for tax seasonal. Who knows how far you can go with something like this. You could always hire someone to build you a website(s) and try maintaining them for you, or you can always do it yourself. With proper training, you can use Git.

Git’s Got Branches

Git is also useful for comparing different version of a project you or someone else may be working on together. Git will allow you to see if a project had issues or became a contributor on other people projects in the open source repository (non-private repository). You can even see who worked on a project last and what the changed or committed on.

You will like using Git because, if you mess up on a file, or accidentally deleted a file, you can easily fix the problem. Git takes a snapshot of your files for safe keeping, and all you have to do is clone it to your system. Nice right?

How to Install git on Windows ~ Download/Install

This training includes step-by-step instructions to make the installing process easier for you. You will be downloading and installing Git to your Windows computer. Are you using a different operating system? You will need to download and follow the documentation offered on the download page for your system. These instructions are for Windows users only.

 

How to Install git on Windows

 

Installing Git on Windows Step-by-step Instructions

  1. Go to the Git official download website for version control software.
  2. Click on the download link to take you to the download page.
  3. Next, locate and click on the link for your operating system platform.
  4. Save the file on your desktop or the chosen location where you like to save your downloads.
  5. After the download has completed, locate the Git file you just download and run it to install it onto your operating system.
  6. An Operators License window will pop up, click on the next button.
  7. Click the next button to install Git into the default destination.
  8. You are looking at the Select Components window, under the Addition Icons section, click on the option that’s marked On the Desktop. This will create a shortcut on your desktop.
  9. Click next.
  10. On the Select Start Menu Folder click next.
  11. In the, Adjusting your PATH Environment window, make sure you click on the option that says Use Git and Optional Unix tools from the Windows Command Prompt.
  12. Click next.
  13. On the Choosing HTTPS, Transport Backend window leave it at the default setting and click on the next button.
  14. In the Configuring the Line Ending Conversions window leave the default setting and click Next.
  15. Leave the Configuring the Terminal Emulator to use Git Bash window at the default setting and click Next.
  16. On the Configuring Extra Options window leave it as the default setting and click install.
  17. Put a check in the box marked Launch Git Bash.
  18. Uncheck the box marked View Release Notes.
  19. Click on finish.

How to Install git on Windows ~ Installing Images

How to Install git on Windows ~ Git Gots Three States

Git has three states on which it operates. I listed them below, following an explanation. These states are important to understanding, and understand will make using your GitHub repository comfortably easy.

The committed state is when your file is stored in your database. While in this state your files are protected, as in safe.

Modified state is when your files have been modified, meaning the file have been changed as in something has been added or taken from the file. However, it does mean it has not been committed to the database, meaning it’s sitting locally on your computer only and not changed in the repo.

The staged state is when your file has been identified to be committed in the next push to the repository. Meaning when the next snapshot of the project is submitted to the database, also commit the changes made in the staged state. In other words, store it permanently to the repository.

I hope I explained the three states in a simple enough way for all to understand.

 

How to Install git on Windows ~ GitHub Repository?

A GitHub repository in wholly is a server or database where web developers project files are being stored. Another developer can choose to contribute in helping with the project, by distributing the files to their local computer and working on them. Companies like Google, Microsoft, Netflix, Twitter, LinkedIn, FaceBook, and Android are using GitHub Repository and have open source project. Let’s go set up your GitHub account. and see what we can build together.

 

How to Install git on Windows

 

Setting up a GitHub Account Step-by-step Instructions

After downloading and installing Git onto your system you will need to create a free GitHub account. Setting up an account is easy with GitHub. You will have to come up with a user name, tell GitHub which email address you are going to be using, create a secure password, and verify your email before you are able to sign and use GitHub. Follow the steps below to complete this part of the tutorial.

  1. Using your favorite browser search for and go to the GitHub official website.
  2. Chose a Username.
  3. Provide GitHub your email address.
  4. Select a secure password using at least one letter, one numeral, and no less than seven characters.
  5. Verify your email address.

You have just successfully created a free GitHub account. Easy enough, right? Now we will move on to creating your GitHub Repository.

Creating a GitHub Repository Step-by-step Instructions

Now that you have created your GitHub account, you will need to create your first repository. The step-by-step directions will walk you through the process. If you have any issues in this part of the tutorial, please contact me and we will get your repository set up together.

  1. Login to your GitHub account.
  2. Click on Start a Project.
  3. On the Create a New Repository page enter the name you wish to call you first repository. I’m calling mine s2w-git-test
  4. Step four is optional, but I highly recommend completing the description by giving a little detail about your project.
  5. Next select if you want your repository to be Public or Private. By default, the public option is selected. You may choose to have a private repository, but there will be a charge. I will be using a public repository on this project for now.
  6. Ok, now click on the box where it says, Initialize this repository with a README.
  7. Next, you will click on Create Repository.

How to install git on Windows ~ Repository Set Up Images

You have just completed creating your first repository. That wasn’t too complicated of a process, let’s test and see if it’s working correctly.

 

Sidenote: It is my opinion that you should create a clone at this point, because you may run into a little problem a little later on in the lesson when you try to pull your files to your repo. I explained what happen to me and placed it in an index.html file. I included it in my git commit so that it pulls with this Git project. You may want to read it before continuing, or if you really want to get some practice on how to troubleshoot a common issue, then you will just follow the lesson as it is. I did place the solution to the issue in practice project 8. That up to you.

 

How to Install git on Windows ~ Set Username/e-mail

Ok, so far you have downloaded and installed Git onto your computer. Also, you have set up your new GitHub account and created your first repository. Now it’s time to start learning how to use the Git Bash command line. There are a few things you will need to perform before you can start placing any files into your repository. At this point of the tutorial, you will have to start using Git regularly in order to get comfortable working with Git.

The Git Bash Interface window should have launched opening the Git terminal window. If your Git Bash terminal window did not open, you will need to go to your desktop and find the Git Bash icon and click on it to open Git. I will now walk you through the process of using your Git Bash command line. Again, follow the step-by-step instructions. Should you run into any problems, please contact me so we can work on getting it resolved together.

  1. In the Git command terminal window type git –version and press Enter. This will tell you what version of Git you are running. If no version shows up, that means Git was not installed correctly. If you see a version than Git was properly installed.
  2. In the Git Bash terminal, type git config –global user.name “YOUR NAME” and press enter on your keyboard. This will let the repository know who is working on the file at what day and time.
  3. Next type git config –global user.email “YOUR VALID EMAIL ADDRESS” and press enter. This will tell the repository the email address to use in case of any reported issues.
  4. Type git config –list and press Enter. This will show you that your user name and email have been configurated. You should not have to every set this up again in the future.

How to install git on Windows ~  Username/email Images

How to Install git on Windows ~ Practicing Make You Better

I just started using VCS, I was so scared I would really mess things up. Silly right? With version control, you are allowed to make as many bloopers as you want. You know why? Because you can always revert your files back to the original state. Cool right? Let’s go practice because practicing will make you a better web developer.

Practice Project 1 ~ Using Git Bash

  1. On your desktop, create a folder and name it whatever you want. I’m calling mine, s2w-git-test.
  2. Right click on the folder you created in step 1.
  3. Find and click on Git Bash Here. This will open a new terminal window with something similar to ~/Desktop/s2w-git-test (master) so close any other terminals you may have open.
  4. We will work from the desktop, so we need to change directory. On the Git Bash terminal window type cd /c/ and then press Enter. You now know how to change directories.
  5. Type ls and then press enter to see what is listed on your c drive. A list of files and folder will populate the Git Bash terminal window.
  6. Let’s change users. Type cd u and hit the tab key on your keyboard. Did you see what happened? Git filled out the rest of the command for you.
  7. Press enter on your keyboard. You saw what happened next. You were taken to the user folder on your local computer. This is easy stuff, let’s learn more commands.
  8. Type cd and start typing in a user name that is located on your computer and press tab, now press the enter key.
  9. Now type cd de hit tab and next press enter. You see how Git Bash took you to the desktop just by using a few little keyboard strokes. It may seem redundant, but it is good practice.
  10. On your keyboard type pwd. Now you can see where you are at on your local system. PWD is a print working directory command. It tells you which local directory you are working in.
  11. Type clear and press enter. This will clear you bash screen, leaving a clean terminal for you to work on.

How to install git on Windows ~ project 1 images

 

Practice Project 2 ~ Make Directory and Remove Command

You will now see how to create a new directory right from inside the Git Bash terminal.

  1. Type mkdir and add a space then type in the name you want to call your new directory. I’m calling this one gittest.
  2. Press enter. If you go to your desktop you will see that a new directory has been created.
  3. Type rm -r and add a space then type in the name of the first directory you made. It should look something like this rm -r gittest. This is how you remove a directory from inside of the bash terminal.
  4. Now press the enter key on your keyboard. If you looked at your desktop you will notice that the directory is now gone. It now resides in your trash bin.

I want you to get used to using the bash terminal. Keep practicing using some of the commands I’ve listed here. I will include a list of the command you are more likely to use the most near the end of this tutorial.

Practice Project 3 ~ git init and git add

You are going to need to know how to initialize a repository, also known as a repo. To initialize your repo use the git init command. Try practicing using the git init command to make repos

  1. Right click on the folder you created in step 1 of the practice 2 project.
  2. Click on Git Bash Here so that it opens up in your bash terminal.
  3. Type git init on the command line. To initialize the repo, press enter on your keyboard.
  4. Type git status and press enter. Notice what happens and read the message the bash terminal delivers.
  5. On the command line type cat > text.txt and press enter.
  6. Type Hello World, welcome to my git training.
  7. Hold down Ctrl and press D (Ctrl+D). You have just learned how to create a file using the bash terminal. type git status to check that it’s on your system. You will see a message telling you that your testing.txt file is untracked. Let’s get Git to track it.
  8. Type git add text.txt. Now press enter. You will not see the message telling us that there are changes to be committed.

 

Practice Project 4 ~ git commit

We are going to make our first commit and use the git log command.

  1. Type git -m “test.txt” and press enter on your keyboard. Your file has been committed. You will get a message showing your committed was completed.
  2. Type git status and hit enter. You will receive a message telling you that you have no files to be committed.
  3. Using the git log command will allow you to see who and when a file was committed. That was fun, so let’s do another one.
  4. This time I want you to go to your desktop and open the testing.txt file located inside of the gittest folder.
  5. Add the following text to the testing.txt file and save it, then close that window. I’m having fun learning how to to use Git and coding from scratch.
  6. Go back to the bash terminal and type git add test.txt and remember to press enter.
  7. Type git commit -a and remember to hit enter on your keyboard. Wow! What happened? I for got to tell you to add a commit message. You are not to worry, I’m going to demonstrate another way for you to make a commit.
  8. I believe the screen you are now looking at is called a VIM. Git wants us to enter a commit message. You can add you commit message by pressing i on your keyboard. This will put your terminal into insert mode.
  9. Now type your commit message. Say some thing like “I’m practicing using the VIM commit mode.
  10. Press the ESC key on the keyboard to exit the insert mode.
  11. Now using lower case type :wq and press enter.
  12. Type git status and press enter.
  13. Now type git log and press enter. You will see something like the message below.

Lenard@seconds2work MINGW64 ~/Desktop/gittest (master)

$ git log

commit 658e200ada92e48b7dff2735cf85ab5b4bec63c8 (HEAD -> master)

Author: LeNard Simmons

Date: Tue Aug 1 01:09:44 2017 -0500

Practing using the VIM commit mode

commit 48c5491abf6c3bedce9c09a695a0b3150202d498

Author: LeNard Simmons

Date: Tue Aug 1 00:23:16 2017 -0500

testing.txt

 

You now know of two ways to make a commit to your repository. I recommend you practice using the Git commands every day. This is the best way to commit to using Git, by practicing and not fearing the Git. You, got? To help you practice I’ve included a list of some basic and advance Git commands near the end of this tutorial. Don’t forget to ask for help when you need it. Let move on to learning how to create a branch.

 

How to Install git on Windows ~ Branches/Merging

Creating a branch in Git will allow you to work on a copy of the files without interfering with the workflow of other contributors and affecting the master files. You will want to create a branch if you were fixing bugs in your code, or if you wanted to add new features like sidebars, navigation menus, and forms. Once you have finished your work, you will be able to merge your new information back into the master branch, allowing other review your modification and add to the project. Let’s learn how to work on a branch.

 

Practice Project 5 ~ git branch

  1. In the bash terminal type git branch and give it a name. It will look like this git branch FirstGitBranch. Now press enter.
  2. To get to your new branch, type git checkout FirstGitBranch and press enter. You will get a message telling you that you have switched to branch FirstGitBranch.
  3. Let’s add a new file to the project. Using the terminal, type cat > index.css. Remember Ctrl+D to exit out of editing the file.
  4. Add your file to the directory using the process I showed you earlier. You can also use the ( git add . ) command. This allows you to add all newly created file in one shot, rather than just adding one at a time.
  5. Check your status to be sure the files were added. Hint: git status.
  6. You need to commit your files. See if you can do it without looking back onto the previous practices.
  7. If the VIM window pops up remember to add your commit messages.

If you were to type dir, you would discover that the new file you created is not there. Not to worry, it will show up when we merge it into the main (master) branch. Let’s see how that is accomplished.

 

Practice Project 6 ~ git merge

In order to merge your changes onto the master branch, you’ll need to make sure you are on the master branch. This is called your destination branch.

  1. To return back the master branch type git checkout master and press Enter.
  2. Use git status to show the branch you are currently on.
  3. Type git merge and the name of the branch you want to merge. in our case, we would type git merge FirstGitBranch. Now press enter.

How to Install git on Windows ~ Project 7 git help

Sometimes when you’re assembling a product like a computer, a website, a bike, or any thing, you can become get confused when it doesn’t work the way it was designed to perform. Especially when you follow the direction to the letter. You check and double check all of your work as you put it together and everything is going great. But sometimes, when you put that last bolt on or solder the final wire, and when you go to use it it just doesn’t work. Have you ever gotten to the point of completely giving up on your project when you absolutely can’t find the answer or right help?

 

How to Install git on Windows How to Install git on Windows

Here’s Your

Superman &

Wonder Woman

The Helpernators’

git — bugout  ‘Your Error Eliminator’

  • git help -a =  Over 100 usable help commands you can use to fix errors.
  • git config –global user.name “Your Name” = Sets the user name.
  • git config –global user.email “Your email Address” = Sets the user email address.
  • cd = Change the directory you are in.
  • cd .. = This is how you can go up a directory inside the bash terminal.
  • clear = This command will clear the Git Bash terminal screen, leaving your work space clean and easier to on.
  • git –version = Tells you which Git Version is installed on your computer.
  • mkdir Name of Directory = This will make a new directory on your computer with in the current directory you are in.
  • git status = This command let you see what you have in your staging area. It checks the status of the working tree and shows the difference between the file or files in the staging area to be indexed.
  • git init = This will initialize the Git Repository on your computer for working locally. It creates a .git folder in your project.
  • git add filename = Use this command if you want to add a specified file or files to the staging area of the Index. The git add file name command tells commit what to write to the repository.
  • git add . = This tells Git to stage every file in the current directory to be committed.
  • git add *.file extention = This tells Git to only stage files ending with the specified extension. This is known as a wild-card.
  • git commit = This command will commit any changed files to the repository that are in the staging area.
  • git push = With this command git will take any file you are working on locally and push it to the Git repository.
  • git pull = If you want to know what the latest changes are in a git repository you will use the git pull command.
  • git clone = If you find a project you wish to work on, git clone will copy it from the GitHub repository to your local your computer.
  • git merge filename = This command will allow you to combine the work from different branches and merge them to the commit.
  • git reset = This tells Git to move the current label back to the way it was before the merge was performed.
  • pwd = This means print working directory. It tells you which local directory you are working in.
  • mkdir name = This is how you make a directory from inside the Git Bash terminal window.
  • rm -r name = This is how you will remove a directory from inside of the terminal window.
  • rm filename.file extention = This will remove a single file from your current directory.
  • cat > filename.fileextention = This will add a file to the current directory.
  • git log = This will tell you who worked on the files last. You can see when the file was last committed, showing the date and time.

Addition Information and Help

If you ever need any additional help with Git you can visit the Git Community or read the Git Documentation. Both of these resources are packed with everything you need to know about using Git and Github. You may want to have a look at Pro Git, written by Scott Chacon and Ben Straub a free guide on using Git. Also, read A visual Git Reference, by Mark Ladto. Remember, I am available also.

 


How to Install git on Windows ~ ![rejected] Fix!

In this section of the tutorial, you’ll be shown how to pull and push in the world of GitHub. You are about to get to what Git is all about. If you do need any help please contact me, remember I’m here to show you how to build a website from scratch.

In and Out of Repo

What I like about GitHub is that a person can actually work on their own projects and place them into a repository. And you can work on other people projects that you find in other repos. There are hundreds of thousands of projects in the GitHub repo just waiting for people like You and me to pull them to our local computers, make some changes, and push them back to a repository. If you are looking for Bible apps, games, music, or just about any kind of references for coding, you can find it on GitHub.

When finding a project you like, you simply pull it to your computer and work on it locally. When you finished you working on the project, you push it to a repository. To show you how easy it is to pull and push a project, I created a step-by-step guide. Remember, I’m here to help you learn about web designing. So, if you have any questions make sure to ask them. Even if you think it may be a silly question, it’s better to ask and know the answer, rather than not ask and be stuck for days.

 


![accepted] Git 🙂 Happy!


Practice Project 8 ~ git clone/pull/push

  1. Follow the steps in Creating a GitHub Repository Step-by-step Instructions. When you completed all 7 steps, come back here to practice project 8, step number 2.
  2. On the right side click the green box marked Clone
  3. You want to copy the URL inside of the box. I highlighted in the image.
  4. Go back to your Git Bash terminal window and type cd .. then press enter. This will place you in the desktop directory.
  5. Now you want type git clone and include the GitHub repository URL. I should look like this. git clone https://github.com/seconds2work/s2w-git-test
  6. Press enter on your keyboard. This will start the cloning process and download the repo into your directory.
  7. Type cd s2w-git-test and press enter. If you see something like ~/Desktop/s2w-git-test (master), you have successfully completed the clone.
  8. Now type ls and press enter. You should now see your README.md file is listed.
  9. Type git remote -v and press enter. This will show you that your fetch and push are set up. I give credit to Data School, a YouTube channel that helped me after hours of searching for a solution to a rejected error. The practice of cloning should be done, right after creating a repo. It makes your first pull easier.
  10. Now type git status, remember to press enter. Your status should show that you are on the master branch and it’s up-to-date with its origin and master. Also, it lets you know if have any untracked files by displaying them in red text, giving you an option to add it to track.
  11. To add the untracked file use the git add . command.
  12. Type git config –global core.autocrlf false If you get the message like, Warning: LF will be replaced by CRLF in text.txt. The file will have its original line endings in your working directory. (this will fix it)
  13. After you add your files and fixed the error, use the git commit -m ‘add test.txt’ command.
  14. Now you need to use the git push origin master command. This will push your files to your Git repository. Goto you GitHub account and you will see your file in the repo.

How to install git on Windows ~ project 8 images

Recap

  • Git keeps track of your code history for you.
  • A snapshot of your files is stored in Gits repository.
  • You choose when to take a snapshot using the commit command.
  • Files are staged before commenting.
  • Other people can contribute to the project and work on their own files without corrupting the original files.
  • Git will allow others to report any issues or bugs in your file., and perhaps offer a fix.
  • With Git you can always revert back to an earlier state.

 


How to Install git on Windows: Lesson 1.4 Conclusion

This will conclude lesson 1.4 of How to Install git on Windows. When we come back, we’re going to jump right into lesson 2.0 How to Write an HTML Code  We’ll be learning about how to setup HTML using a sources code. Are you ready to start writing in code? Good, because now, we will learn the fundamentals of HTML while learning how to build a website from scratch.


Start Lesson 2.0 How to Write an HTML Code

That’s all for now. If you like this post, kindly hit the like button and share it with anyone you can think of that will benefit from it. If you have any questions, want to give an opinion, comments, or feedback, please leave them in the comment section down below. Thank you and God bless you.


Learn Internet Marketing ~ 2 Free Full Courses ~ More Info ~

My true feeling about creating a website by hand coding it; It’s like a Thanksgiving meal. Not just any kind of turkey day dinner. More like the kind grand mom’s cook; Make it from scratch she used to tell us. You’ll put more love into a home-cooked meal she would say. I guess I’m kind of old spirited and like creating things the old fashion way. Build them to last a life time. ~ LeNard’s View ~



Build a better website in less than an hour. Start for free at GoDaddy.


Please share this post
Share

8 thoughts on “How to Install git on Windows ~ I Git Repo”

  1. Hi Irvie, thanks you for the comment.  I’m glad the video helped. To answer your question, your file will be saved on your Git repo account and on your computer. Just in case there is a fire, you can retrieve them from Git.

  2. Hey LeNard,
    Lots of great info in here! I am kind of a dummy when it comes to computers, so even though there is a mind boggling amount of stuff here, it’s great to have it step-by-step, all in one place! And thanks for the video. It’s a tremendous help to have both oral and verbal instructions for us newbies. This is probably a silly question, but is this saved to my computer or is it saved online? So if my computer burns up in a fire, are my source files safe?

  3. I know Github can be such a useful tool in the web development community so I’m try to get into it more and learn more about it and the benefits. I like the feature of having different versions of the website you can just switch on and off if you want to change it for the season or certain sales or something. Do you have instructions for how to setup Git on Mac? Is that possible?

  4. Thank you, Heather, I’m happy to hear that you are interested in giving Git a second look. Git is an excellent way to keep track of your business progress as far as development of your website or any kind of app, or software development goes.

  5. This was a very in-depth interesting article on Installing Git on Windows. I have done some research on it, but as a novice it is a little daunting. You have some really well laid out roadmaps and have peeked my interesting in revisiting this subject. I will plan to refer back to your site in the future as a reference. Thank you!

  6. Christine, thank you or the idea. I will see if I can find one the will suit the need. Did you have any questionns about the process?

  7. I found your site to be very informative and knowledgeable.I have never heard of git before so I thank you for this information.I hope your site gives you everything you need. Keep up the good work.The only thing I did not find on your site was videos.If you had a video showing how to install git it would have been better.

Leave a Reply

Your email address will not be published. Required fields are marked *