top of page

Welcome
to NumpyNinja Blogs

NumpyNinja: Blogs. Demystifying Tech,

One Blog at a Time.
Millions of views. 

“Git Made Simple: A Beginner's Guide Using VS Code, Terminal, and Eclipse”

May 1, 2025
6 min read

                          Just stepping into the world of software development, you’ll hear the word Git a lot. But what exactly is Git? And why is it so important for software engineers?

Let’s break it down in simple terms.

                                                

Git is a version control system — a tool that helps you keep track of changes you make to your code over time.

In today’s agile world, version control isn't just for developers. Testers—especially automation testers—must also understand Git basics to collaborate better, track test script changes, and contribute effectively to the team.

Why Do Software Engineers Need Git?

1.     Tracking Changes - Git keeps a full history of every change made in a project — who made it, what was changed, and when

2.     Undoing Mistakes -Made a mistake? No problem. Git lets you go back to any previous version of your code, saving hours of stress and rework.

3.     Working in Teams -Most software today is built by teams, not just individuals. Git allows multiple people to work on the same project at the same time without overwriting each other's work. It keeps everyone's changes organized and makes combining them easy.

4.     Experimenting Safely -Git lets you create a branch — a separate copy of your code — where you can experiment freely.

 

       If Git feels intimidating, don’t worry. In this post, we’ll walk through simple Git workflows using:

  • Visual Studio Code

  • Command Prompt / Terminal

  • Eclipse Git Integration


     Basic Git Workflow

Here’s the basic flow you need to master:

  1. Clone a repository

  2. Create a new branch

  3. Add changes

  4. Commit changes with a meaningful message

  5. Push the changes to remote

  6. (Optional) Create a Pull Request to merge into the main code


How to Use Git Through Command Prompt / Terminal

Open git bash / Terminal




Enter the below commands for each step in the bash

Step 1: Clone a Repository

cd your-repo-name

this command will allow you to connect to your repository in GitHub

git status

to know the latest status if the branch / repo

Step 2: Add, Commit, and Push

git add .

git commit -m "Added new login test case"

git push origin main

Step 3: Pull the Latest Changes

git pull origin main

Step 4: Create and Switch Branches

git checkout -b feature/new-login-tests

Insight :

  • Always pull before you push to avoid conflicts!

  • Use git status to check your current working state.

 Tip: Always pull the latest changes from main or master before starting (git pull origin main).

Quick look :

Command

What It Does

git clone [url]

Copy a repo to your local machine.

git status

Check what changes are pending.

git add .

Stage all changes for commit.

git commit -m "Message"

Save a snapshot with a message.

git push

Upload your commits to the remote repo.

git pull

Get the latest changes from the remote repo.

git checkout -b [branch_name]

Create and switch to a new branch.

git merge [branch_name]

Merge a branch into your current branch.

 

 

Also another way around , if you want to initialize git in a particular project ,  

Navigate to your project folder ,  

1. Double click on the folder and right click

  1. Select show more option

3. click on  open git bash here




Result: eases the process of initiating the git.


Advanced Git Commands

 

Feature

Purpose

Command Example

stash

Save unfinished work temporarily

git stash

revert

Undo a specific commit safely

git revert <commit-hash>

rebase

Create a cleaner, linear history

git rebase <branch>

cherry-pick

Apply a specific commit from another branch

git cherry-pick <commit-hash>

tag

Mark important points like releases

git tag v1.0

clean

Remove untracked files or folders

git clean -fd

log --graph

See a visual tree of commits

git log --oneline --graph --all

amend

Modify the last commit (message or content)

git commit --amend


 

Hack : Similarly, you can select Git GUI, which gives a user-friendly interface to access git repositories



Git Through Eclipse (Egit Plugin)

If you are an Eclipse user, Git integration (called Egit) is built in!

Step 1: Clone or Import a Git Repository

  • File ➔ Import ➔ Git ➔ Projects from Git ➔ Clone URI.

  • Enter the GitHub repo URL and follow the prompts.




Create a new branch:

  1. Right-click the project → Team → Switch To → New Branch.

 

Step 2: Commit Changes

  • Right-click on the project ➔ Team ➔ Commit.

  • Enter a commit message ➔ Select the files ➔ Click Commit and Push.

Step 3: Pull and Push

  • Right-click on the project ➔ Team ➔ Pull before you start working.

  • After making changes, Team ➔ Push to Upstream.

Step 4: Create New Branch

  • Right-click ➔ Team ➔ Switch To ➔ New Branch ➔ Give a branch name.

Visual Tip: EGit will show red (unstaged) and green (staged) icons for files to help you track changes.

Other ways to open git in eclipse

  •   Windows ➔ show view➔ other➔  Git Repositories




We can use terminal also in eclipse to work as similarly in git bash using same commands

  •   Windows ➔ show view➔  terminal


 Git Through Visual Studio Code


VS Code has built-in Git support that makes life super easy.

Basic Steps:

  1. Clone a repository:

    • Open VS Code.

    • Click on Source Control (🔃 icon on the sidebar).

    • Select Clone Repository → Paste repo URL → Choose a folder.




           

Enter the git repository to clone in the bar  and authorize , then enter your Git hub password and it authorizes and lists all the repositories you have in your git account.

  1. Create a branch:

    • Bottom left corner → Click branch name → Create new branch.


  1. Make changes to your test scripts.




U – Unstaged shows changes are made to file and need to staged

  1. Stage and Commit:

    • Under Source Control, you’ll see changed files.

    • Click + to stage → Write a commit message → Click ✔️ to commit.






Enter the commit message

  1. Push Changes:

    • Click the "Synchronize Changes" button on the bottom bar.

    • Or use the menu: Source Control → Push.



Open in GitHub and see if your latest changes are pushed to the branch



 Suggestion : Use extensions like GitLens to visualize commit history easily!


 Takeaways we should avoid in Git

  • Don’t commit without pulling the latest code first.


     (Use git pull before you start working.)

  • Don’t push directly to main or master.


     (Always work on a branch and open a Pull Request.)

  • Write clear, meaningful commit messages.


     (E.g., “Added password reset positive test case” instead of just “changes”.)

 

Reference Table

Action

VS Code

Terminal

Eclipse Git

Clone Repository

GUI Clone

git clone

Import from Git

Create Branch

Click branch name → New Branch

git checkout -b <branch>

Team → Switch To → New Branch

Stage Changes

+ button

git add .

Select files in Commit dialog

Commit Changes

✔️ checkmark

git commit -m "message"

Team → Commit

Push Branch

Sync Changes button

git push origin <branch>

Team → Push

 Core Git Concepts

Git Term

Meaning

Repository (Repo)

A place where your code is stored (locally or online like GitHub).

Commit

A snapshot of your changes.

Branch

A parallel version of your code for experimentation.

Merge

Bringing changes from one branch into another.

Push/Pull

Syncing between your local machine and the remote repository.

Git and GitHub — Are They the Same?

You might also hear about GitHub, GitLab, or Bitbucket. Git is the tool that runs on your computer to track changes. GitHub (and others) are online platforms where you can store your Git projects and collaborate with others over the internet. Think of Git as your personal notebook, and GitHub as a library where you can share your notebook with others.

 

So to have a virtual experience you can view your repository and project updates on GIT HUB

 GitHub Tasks

 Feature

💬 How the Feature is Used

📁 Repository Creation

"Use repositories to organize and manage project code, documentation, and version control in one centralized location."

👥 Collaborator Access

"Add team members as collaborators to enable shared access, role-based permissions, and real-time contributions across remote teams."

🔍 Commit History

"View commit logs and file changes to track code evolution, review updates, and ensure accountability in team contributions."

💻 Git Commands

"Use commands like git commit, git push, and git pull in Bash, Eclipse, or Visual Studio to manage source code versions and sync with GitHub."

🌿 Branching Strategy

"Create and manage feature branches to isolate development work, test changes independently, and merge updates without disrupting the main codebase."

🔄 Pull Requests & Reviews

"Initiate pull requests to propose code changes, request peer reviews, and manage approvals before merging into shared branches."

💬 Issues & Discussions

"Leverage GitHub Issues and Discussions for task tracking, bug reporting, feature planning, and asynchronous team communication."

 Getting started with Git might seem tricky, but with tools like VS Code, the terminal, or even Eclipse, you’ve got plenty of ways to make it work for you. Just remember—every pro was once a beginner who didn’t give up. Keep experimenting, break things (safely!), and have fun along the way.


"The expert in anything was once a beginner." – Helen Hayes


 
 

+1 (302) 200-8320

NumPy_Ninja_Logo (1).png

Numpy Ninja Inc. 8 The Grn Ste A Dover, DE 19901

© Copyright 2025 by Numpy Ninja Inc.

  • Twitter
  • LinkedIn
bottom of page