Basic Commands for Bash, Linux, CMD, and GIT
-
- List command:
ls
- Change Directory:
cd 'directory_name'
- Clear Page:
clear
- Make Directory:
mkdir 'directory_name'
- Remove Directory:
rmdir 'directory_name'
- Edit a File:
nano 'filename'.extension
- Create a File:
touch 'filename'.extension
- Remove a File:
rm 'filename'.extension
-
- Change Directory:
cd "filename".extension
- List All Directories:
dir
Make Directory (folder):
mkdir 'directory_name'
- Remove Directory:
rmdir 'filename'
- Delete file:
del 'filename'.extension
- Shows manual help:
help
-
- Change directory:
cd 'directory_name'
- List all directory:
ls
- Make Directory:
mkdir 'directory_name'
- Delete file/dir (-f) [here, (-f) means force]:
rm
- Displays the current Directory:
pwd
- Shows Manual Help:
man
-
- clone a Repository:
git clone <URL>
- Initializing a GIT Repository:
git init
- Getting staging status:
git status
- Show git log:
git log
- Add Files to Staging Area:
git add .
- Commit changes:
git commit -m " "
- Change Working Branch:
git checkout 'branch_name'
- Push Command:
git push <remote name> <branch name>
- Force Push Command:
git push <remote name> <branch name> --force
- Creating new Branch:
git switch -c <new-branch-name>
or
git branch <new-branch-name>
- Pull latest commit from remote:
git pull <remote> <branch>
- View all branches:
git branch
- Delete Branch:
git branch -d <branch-name>
- Merge Repository:
git merge <repo name>
- Compare Difference Between 2 commits
git diff <commit_1 id> <commit_2 id>
For any issues or suggestions, please Contact Me