Git-Bash Commands

Introduction

An application called Git Bash gives operating system users access to the Git command line. It is a command-line shell that enables git on the system’s command line. Version control systems and development processes are supported by the text editor VSCode. It offers resources so a user may create codes without difficulty. These act as prerequisites, thus one should be familiar with them.

Git was initially created to facilitate collaboration among programmers working on source code throughout the software development process. Git is a distributed version-control system for monitoring changes in any set of files.

Git command can be written either in Git-bash or itself in VS-Code terminal. Some of the basic Git-bash commands are as follow:

pwd

pwd command refers to print working directory. The complete path name of your current directory is written  by the pwd command . There is a / between each directory (slash). The first / stands for the root directory, and the last directory listed is the one you are currently in.

ls

ls command refers to list. All the list of files and folder inside the current directory is enlisted with the help of this command.

clear

clear command refers to clearing all the commands.This command is used to bring the command line on top of the computer terminal.

cd

cd command refers to current directory. It helps to display the current folder we are working on.

Syntax for using cd command is:
cd F : //

mkdir

mkdir command refers to make directory. Directory refers to any folder.We can make any folder using mkdir command.

Syntax for using mkdir command is:
mkdir “foldername”

If we don’t want to use double quotation mark for, we an simple write name of folder using _ sign.for example:
mkdir folder_name

Question to arise
1. What if we don’t use _ sign?
- If we don’t use _ sign while writing folder name and simply write mkdir folder name, then there will be two folder created with name folder and name.

cd..

cd.. command refers to go back. This command is used to return back from existing directory path.

touch

touch command is used to create a file inside any folder.

Syntax to create file inside any folder:
touch “file name.extension”

rm

rm command refers to remove.This command is used to remove ani file inside the folder.

Syntax to remove file from any folder:
rm “file name”

rm -rf

rm -rf command refers to remove with recursive force. This command is used to remove a complete folder with its all file.

Syntax to remove folder:
rm -rf “folder name”

Summary of using Git-bash command in VS-Code

  1. Git bash command are useful way to work faster by the programmer. Developer doesn’t want to spend their time working with computers basic functionality . They simply want to code the function to work easier in the program.
    Insted of going all way around to create new folder, file, delete, modify and other various work we can simply write code for these kind of setup in terminal. Terminal provides us platform to crete shortcut basis to work in the text-editor.