0% found this document useful (0 votes)
24 views

Git Local Environment Setup (Windows)

The document provides step-by-step instructions for setting up a local Git environment on Windows, including installing Git, configuring username and email settings, creating a GitHub account, and pushing a commit to a remote GitHub repository. Key steps include downloading Git for Windows, selecting options during installation, setting the username and email in Git, signing up for a free GitHub account, creating a new remote repository on GitHub, initializing a local repository, adding and committing a file, and pushing the local commit to the remote GitHub repository.

Uploaded by

Sach Deva
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Git Local Environment Setup (Windows)

The document provides step-by-step instructions for setting up a local Git environment on Windows, including installing Git, configuring username and email settings, creating a GitHub account, and pushing a commit to a remote GitHub repository. Key steps include downloading Git for Windows, selecting options during installation, setting the username and email in Git, signing up for a free GitHub account, creating a new remote repository on GitHub, initializing a local repository, adding and committing a file, and pushing the local commit to the remote GitHub repository.

Uploaded by

Sach Deva
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

(/)

Git Local Environment Setup


(Windows)

Read Time: 20 mins

In this article we will cover how to set up a local


environment in order to use Git on your own Windows
PC. Let's go through the steps and get you set up!

What You Need:

Your own PC with Windows installed


Basic knowledge to operate Command Prompt
Text Editor (ie. Atom) (If you don't have Atom
installed on your PC, please view the How to Make
a Website with HTML and CSS
(https://progate.com/docs/html-env-win) article)
To have completed the Progate Git Study I
(https://progate.com/git/study/1/1#/0) and
Command Line Study I
(https://progate.com/commandline/study/1/1#/0)

Note: This article is for Windows users. Please read


this article (https://progate.com/docs/git-env) if you
are using a Mac.

1. Installing Git  Contact us!


Firstly, let's install Git from Git for Windows
(https://gitforwindows.org/) .

(/)

Git for Windows

After the download is complete, open the file and an


installation screen will pop up. Let's follow the
prompts and complete the installation.

Step 1. Once you agree to the terms and conditions,


click "Next"

Click "Next"

Step 2. Click "Next"

 Contact us!

(/)

Click "Next"

Step 3. Click "Next"

Click "Next"

Step 4. Click "Next"

 Contact us!

(/)

Click "Next"

Step 5. We must select the editor. Choose the editor


that you will use and click "Next"

(The example below is for Atom)

Select the editor and click "Next"

Step 6. Check "Use Git from Git Bash only" and click
"Next"

 Contact us!

(/)

Step 7. Check "Use the OpenSSL Library" and click


"Next"

Step 8. Check "Checkout Windows-style, commit Unix-


style line endings" and click "Next"

 Contact us!

(/)

Step 9. Check "Use MinTTY (the default terminal of


MSYS2)" and click "Next"

Step 10. Check all of the options and click "Next"

 Contact us!

(/)

Step 11. Click "Install"

Now the installation will complete.

Step 12. Click "Finish" and you will be able to start


using Git!

 Contact us!

(/)

Now on your PC, there should be an application called


Git Bash installed. This is a great tool to use for all
your future development!

Git Bash has been installed

Check
Is Git installed on your PC?

 Done?

 Contact us!

(/)
2. Initial Git Setup

First, let's open up Git Bash

Open up Git Bash

After it opens, your screen should look like the one


below.

Git Bash startup screen

Set up a username and email address

By setting up a username and email address in Git, any


commits made will be recorded and you will be able to
identify who the commits were created by.

Run the commands below to set up your details:

 Contact us!
git config --global user.name 
"username"
(/)

git config --global user.email "email


address"

(You can choose your own username and email


address)

Below is just an example.

Setting up the user details

Now the initial setup is complete!

Check
Have you successfully setup username and email address?

 Done?

 Contact us!

(/) 3. Setting Up GitHub

From here, we will be looking at how to add a new


remote repository by utilizing a service called Github.

You will create a remote repository like the one


Master White prepared for you in Git Study I .

Setting up a Github account

In order to utilize Github, let's make an account.

To create an account, visit the Github Official Page


(https://github.com)

Screen when you access the page

Once you have signed up and followed the prompts,


you will be taken to a subscription selection page.

To use Github for free, click the "Free" option and then
the "Continue" button at the bottom left.

 Contact us!

(/)

Subscription option page

After selecting the subscription you will be asked


multiple questions, but you do not need to answer
them.

Lastly, click the "Submit" button and your account


setup will be complete!

Once you have set up your account, you will receive a


verification email. Click on the link attached in the
email, and now you will be able to start using your
Github account.

Creating a new remote repository

To create a new remote repository, click on the "+"


button in the header on the top right.

Creating a new remote repository

 Contact us!
After clicking the "+" button, click on "New
repository."

(/)
By clicking "New repository", you will be navigated to
the page below.

Type in a project name where it says "Repository


name" and click "Create repository" to create a new
remote repository.

New repository details

Once the remote repository is created, you will be


directed to the page below.

The remote repository has been created

 Contact us!
Check 
Were you able to register GitHub and create a new remote
(/)
repository?

 Done?

4. Pushing to GitHub

Let's try pushing local repository content to the


remote repository we created on GitHub.

Preparing to use Git

Using Git, you must first create a directory and move


to that directory by running the following commands:

mkdir mysite

cd mysite

After running the commands


 Contact us!
To be able to manage that file in Git, you must run the
following command:

(/)

git init

After you have run the git init command, please


copy the line starting with "https" as shown below.

Copy the URL

Once you have copied the line, replace the <URL> and
run the following command:

git remote add origin <URL>

This command specifies the remote repository you


want to transfer your local repository content from.

Specify the remote repository

Push

Next, in order to push, you must create a file and


commit it.  Contact us!
touch index.html 
(/)

git add index.html

git commit -m "Create index.html"

Now you will use the "git push" command:

git push origin master

Let's check if the commit was pushed successfully on


GitHub.

You should see an "index.html" file on GitHub if you


have done everything correctly.

Check that the commit was pushed

Check
Have you successfully pushed to remote repository?

 Done?

 Contact us!

(/)
Now, you are able to use GitHub to manage your
projects!

By utilizing Git and GitHub, you will be able to


smoothly manage collaborative projects!

Share with friends!

 

Back to Courses (/languages)

 Contact us!

You might also like