Basic commands

Bash shell

Command Description
ls list contents of current folder
ls -F Projects list contents of particular folder
cd change current folder
pwd print path of current folder
mkdir create an empty folder
touch note.md create an empty text file called note.md
mv note.md notes.md rename file to notes.md
rm -i notes.md remove notes.md file

Git

Command Description
git config user.name <username> set name associated with commits
git config user.email <email> set email associated with commits
git init track file(s) within a folder
git clone <repository url> create local copy of remote repository
git add include file(s) in next commit
git commit -m <"message"> take snapshot of changes to file(s)
git status check status of file(s)
git log view commit history
git diff view unstaged changes
git remote add <name> <url> connect local repository to remote repository
git fetch <remote> <branch> retrieve changes from remote branch
git pull <remote> retrieve commits from a remote repository to local repository
git push <remote> <branch> send commits in local repository to remote repository
git revert <commit> create new commit that undoes changes made in previous commit
git reset <file> remove file from staging area
git branch create new branch
git checkout –b <branch> switch to new branch
git merge <branch> merge branch into current branch