git config --global user.name "<username>"
git config --global user.email "<email>"
git clone <repository_URL>
git init
git status
git add <filename>
git add .
git commit -m "<Commit_message>"
git restore <filename>
git checkout <filename>
git remote add origin <Your_remote_git_URL>
git remote remove origin
git push origin <branch_name>
git checkout -b <branch_name>
git switch master
ls option_flag arguments
--> list the sub directories and files avaiable in the present directory
Examples:
-
ls -l
--> list the files and directories in long list format with extra information -
ls -a
--> list all including hidden files and directory -
ls *.sh
--> list all the files having .sh extension. -
ls -i
--> list the files and directories with index numbers inodes -
ls -d */
--> list only directories.(we can also specify a pattern)
-
pwd
--> print work directory. Gives the present working directory. -
cd path_to_directory
--> change directory to the provided path -
cd ~
or justcd
--> change directory to the home directory -
cd -
--> Go to the last working directory. -
cd ..
--> change directory to one step back. -
cd ../..
--> Change directory to 2 levels back. -
mkdir directoryName
--> to make a directory in a specific location
Examples:
mkdir newFolder # make a new folder 'newFolder'
mkdir .NewFolder # make a hidden directory (also . before a file to make it hidden)
mkdir A B C D #make multiple directories at the same time
mkdir /home/user/Mydirectory # make a new folder in a specific location
mkdir -p A/B/C/D # make a nested directory