Skip to main content

Python print() Function

When you start learning Python, one of the first things you need to learn is how to display information on the screen. For example, you might want to display: A welcome message. Your name and age. The result of a mathematical calculation. Student marks and results. Information generated by a Python program. Python provides a built-in function called print() for displaying information. The print() function is one of the simplest and most frequently used functions in Python. It helps programmers display information while testing programs, solving problems, and developing applications. In this article, we will learn how to use print() with practical examples and their outputs. 1. What Is the print() Function in Python? The print() function is a built-in Python function that displays information in the output area, usually the terminal or console. Let's look at a simple example. print("Hello, World!") Output: Hello, World! In this example, Python displays the text Hello,...

Installing Git on Windows, macOS, and Linux: A Complete Step-by-Step Guide

Now that you understand what Git is, why it was created, and how it differs from GitHub, it's time to install Git on your computer.

Installing Git is the first practical step toward becoming a Git user. Fortunately, the installation process is simple and only takes a few minutes.

In this article, you will learn how to install Git on Windows, macOS, and Linux, verify that the installation was successful, configure Git for the first time, and understand the purpose of the initial configuration.

By the end of this article, your computer will be fully prepared for the practical Git lessons that follow.


What is Git Installation?

Git is software, just like Java, Python, or Google Chrome.

Before using Git commands, you must install Git on your operating system.

After installation, Git provides:

  • Git Command Line

  • Git Bash (Windows)

  • Git GUI (optional)

  • Git libraries and utilities

Once installed, you can execute Git commands from the terminal or command prompt.


System Requirements

Git is lightweight and works on almost every modern computer.

Minimum requirements:

  • Windows 10 or Windows 11

  • macOS 11 or later

  • Linux (Ubuntu, Debian, Fedora, Arch, etc.)

  • At least 200 MB of free storage

  • Internet connection (only for downloading Git)


Installing Git on Windows

Git for Windows is the most commonly used installation package.

Step 1: Download Git

Open your web browser and visit the official Git website:

https://git-scm.com

Click the Download for Windows button.

The download will start automatically.


Step 2: Run the Installer

Locate the downloaded installer.

Example:

Git-2.xx.x-64-bit.exe

Double-click the installer.

If Windows displays a security message, click Yes.


Step 3: Welcome Screen

The Git Setup Wizard opens.

Click Next.


Step 4: Choose Installation Location

The default installation location is usually:

C:\Program Files\Git

Leave it unchanged.

Click Next.


Step 5: Select Components

The default components are suitable for most users.

Recommended options include:

  • Git Bash

  • Git GUI

  • Windows Explorer Integration

  • Git LFS (optional)

Leave the default selections.

Click Next.


Step 6: Choose Default Editor

Git asks which text editor should be used.

Common choices:

  • Visual Studio Code (Recommended)

  • Notepad++

  • Vim

  • Nano

If Visual Studio Code is installed, select it.

Otherwise, keep the default editor.

Click Next.


Step 7: Initial Branch Name

Git asks for the default branch name.

Choose:

main

This is the modern standard used by most projects.

Click Next.


Step 8: PATH Environment

Choose:

Git from the command line and also from third-party software

This allows Git commands to work in:

  • Command Prompt

  • PowerShell

  • Git Bash

  • Visual Studio Code Terminal

Click Next.


Step 9: HTTPS Transport Backend

Choose:

Use the OpenSSL Library

Click Next.


Step 10: Line Ending Conversions

Recommended option:

Checkout Windows-style, commit Unix-style line endings

Click Next.


Step 11: Terminal Emulator

Select:

Use MinTTY (the default terminal of MSYS2)

Click Next.


Step 12: Default Git Pull Behavior

Choose:

Fast-forward or merge

Click Next.


Step 13: Credential Helper

Select:

Git Credential Manager

This securely stores your GitHub credentials.

Click Next.


Step 14: Additional Options

Keep the default options.

Click Install.

The installation takes about one or two minutes.

Finally, click Finish.

Congratulations! Git is now installed on Windows.


Installing Git on macOS

macOS users have multiple installation options.

Option 1: Install Using Homebrew (Recommended)

Open the Terminal and run:

brew install git

Wait for the installation to complete.


Option 2: Install Using Xcode Command Line Tools

Run:

git --version

If Git is not installed, macOS will prompt you to install the Xcode Command Line Tools.

Click Install and wait for the process to finish.


Option 3: Download Installer

Visit:

https://git-scm.com

Download the macOS installer and follow the installation wizard.


Installing Git on Linux

Most Linux distributions include Git in their package repositories.

Ubuntu / Debian

sudo apt update

sudo apt install git

Fedora

sudo dnf install git

CentOS

sudo yum install git

Arch Linux

sudo pacman -S git

Verifying the Installation

After installation, open your terminal or command prompt.

Type:

git --version

Example output:

git version 2.50.1

If you see the version number, Git has been installed successfully.


Understanding the Git Terminal

Depending on your operating system, you may use:

Windows

  • Git Bash

  • Command Prompt

  • PowerShell

  • VS Code Terminal

macOS

  • Terminal

  • VS Code Terminal

Linux

  • Terminal

  • VS Code Terminal

All of these can execute Git commands.


First-Time Git Configuration

After installing Git, you should configure your identity.

Git records the author's name and email with every commit.

Set Your Name

git config --global user.name "Your Name"

Example:

git config --global user.name "Rahul Sharma"

Set Your Email

git config --global user.email "your@email.com"

Example:

git config --global user.email "rahul@gmail.com"

Always use the same email address that you plan to use for GitHub.


Why is Configuration Important?

Whenever you create a commit, Git stores information such as:

  • Author Name

  • Email Address

  • Date

  • Time

  • Commit Message

This allows Git to identify who made each change.


Checking Your Configuration

To display all configured settings, run:

git config --list

Example output:

user.name=Rahul Sharma
user.email=rahul@gmail.com

Where Does Git Store Configuration?

Git can store configuration at three different levels.

System Level

Applies to all users on the computer.

Command:

git config --system

Global Level

Applies only to your user account.

Command:

git config --global

Local Level

Applies only to the current repository.

Command:

git config --local

Priority:

Local
   ↓
Global
   ↓
System

Local settings override Global settings, and Global settings override System settings.


Updating Your Name or Email

If you make a mistake, you can update the values at any time.

Example:

git config --global user.name "Amit Kumar"
git config --global user.email "amit@gmail.com"

The new values replace the old ones.


Common Installation Problems

Problem 1

Error

git is not recognized as an internal or external command

Solution

Restart your computer or reinstall Git, ensuring that Git is added to the system PATH.


Problem 2

Command Not Found

git: command not found

Solution

Git is not installed correctly or is not available in the system PATH.


Problem 3

Wrong Version Displayed

Update Git by downloading the latest version from the official website or using your operating system's package manager.


Best Practices After Installation

Once Git is installed:

  • Keep Git updated.

  • Configure your name and email immediately.

  • Use Visual Studio Code as your default editor if possible.

  • Verify the installation using git --version.

  • Use Git Bash or a terminal for practice.


Summary

Installing Git is the first practical step in learning version control. The process is straightforward across Windows, macOS, and Linux. After installation, verifying the version and configuring your name and email ensures that Git is ready to track your work correctly.

With Git successfully installed, you are now prepared to create your first repository and begin using Git commands.

Comments

Popular posts from this blog

Understanding Comments in Java: A Beginner’s Guide

When learning Java programming, one of the first concepts you’ll come across is comments . Comments may not affect how a program runs, but they play a crucial role in making code more understandable, readable, and maintainable. Let’s dive deeper into what comments are, why they’re important, and the different types of comments in Java. What are Comments in Java? A comment in Java is a piece of text written within a program that is ignored by the compiler . In other words, comments are notes for humans, not instructions for machines. They help developers explain the purpose of code, describe logic, or temporarily disable certain lines of code without deleting them. Why are Comments Important? 📌 Readability – Comments make code easier to understand for you and others. 📌 Maintenance – When you revisit your code after months, comments remind you what you were doing. 📌 Collaboration – In team projects, comments explain code to fellow developers. 📌 Debugging – You c...

Java Program to Check Voting Eligibility

In this program, we’ll take the user’s age as input and check whether the person is eligible to vote or not. In India, the minimum age required to vote is 18 years . 💻 Program Code // Java Program to Check Voting Eligibility import java.util.Scanner; public class VotingEligibility { public static void main(String[] args) { // Create Scanner object to take input from user Scanner sc = new Scanner(System.in); // Ask user to enter age System.out.print("Enter your age: "); int age = sc.nextInt(); // Check eligibility if (age >= 18) { System.out.println("You are eligible to vote."); } else { System.out.println("You are not eligible to vote yet."); System.out.println("You can vote after " + (18 - age) + " year(s)."); } sc.close(); // Close the scanner } } 🧠 Explanation import java.util.Scanner; → Imp...

Java Program to Calculate Total Marks and Average of Five Subjects

💡 Program Explanation In this program: The user will input marks of five subjects . The program will calculate the total marks and average . It will then display both results clearly. 🧑‍💻 Java Code: // Java Program to Calculate Total Marks and Average of Five Subjects import java.util.Scanner; // Importing Scanner class for user input public class TotalAndAverage { public static void main(String[] args) { // Creating Scanner object to take input from user Scanner sc = new Scanner(System.in); // Declaring variables for five subjects double subject1, subject2, subject3, subject4, subject5; // Taking marks input for each subject System.out.print("Enter marks of Subject 1: "); subject1 = sc.nextDouble(); System.out.print("Enter marks of Subject 2: "); subject2 = sc.nextDouble(); System.out.print("Enter marks of Subject 3: "); subject3 = sc.nextDo...