Italian Trulli

GIT Commands For Software Testers , Developer

Test Tribe
.

 GIT Commands For Software Testers (Automation Testers)

Here list of git commands that every software tester should know.

  • git Version 
  • git init 
  • git clone 
  • git add. 
  • git commit -m "message" (commit changes)
  • git push 
  • git pull 
  • git diff 
  • git status 
  • git log
GIT Branch
  • git branch (branch name)
  • git branch
  • git checkout -b(branch name)
  • git branch -m(branch name)
  • git branch -d (brnach name)
  • git checkout (branch name)
GIT Merge


GIT Command For Software Tester 

How to check the git version or verify whether the git is installed or not?

Git version Command

The git version command is used to know the version of git and also to verify whether the git is installed properly or not.

When we use: When we have to check the version of git then we use git version command.

Command: git --version

Git command to check the version- GIT Version Command


How to Initialize a New Git Repository in Local?

Git init Command

To Initialize a new Git repository use the git init command. If you want to place a project under revision control, this is the first command you need to learn. git init also Initializes the folder as a git repository.

Command: git init

GIT init Command

How to clone a GitHub Repository on a Local Machine?

Git Clone Command

The git clone command is used to create a copy of a specific repository or branch within a repository.

Command: git clone <repository-link>

GIT Clone Command


Git add Command 

The git add command is used to add the file content to the staging area.

There are two types of add commands in GIT.
  • git add <file name>
  • git add.
  • git add <file name> (add a single file)
Git Add Command


  • git a. (add all files)


Git Commit Command

Command: git commit -m "message" 

GIT Commit Command


Git Push Command

Command: git push origin master

GIT Push Command


git pull 

git diff (to get the exact change in file line by line)

git status (to get the file name in which changes are done)


Branch In GIT

How to Create a New Branch in GIT?

In Git there are two ways to create a branch.

1) git branch branch name
2) git checkout -b branch name

1) GIT Branch Branch Name

The Git branch branch name command is used to create a new branch in the main branch.

Note: Using this command system will create only a new branch user needs to switch from the main to the new branch.

Command: git branch branch name
Example: git branch feature1

How to create a new branch in GitHub


2) GIT Checkout -b Branch Name

The Git Checkout -b branch name command is used to create a new branch in the main branch.

Note: Using this command system will create a new branch and directly switch to the newly created branch user does not need to switch manually.

Command: git checkout -b branch name
Example: git checkout -b feature2

How to create a new branch in the git hub


How to Check the Branch List in Github (All Branch available in main).

GIT Branch 
Git branch command in git is used to check the list of branches available in the main.

Command: git branch

How to check all the branch list 


How to Rename the current branch name in GitHub

Git branch -m branch name
Git branch -m branch name is used to rename the current branch.

Command: git branch -m current branch name
Example: git branch -m feature2

How to rename the current branch name in Git


How to delete a branch in Github.

git branch -d (branch name)
git branch -d branch name in Git is used to delete a branch from the git.

Commandgit branch -d branch
Examplegit branch -d feature2

How to delete a branch in Git

How to Switch one branch to another branch in git.

git checkout branch name

git checkout branch name is used to switch from the current branch to another branch.

Commandgit checkout branch name
Example: git checkout main

how to switch branch in git


Hope!!! The above Tutorial on GIT Commnad For Software is helpful For you...

Team,
QA acharya

Post a Comment

0 Comments