# Starting New project in git
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/svnshikhil/Node_Skelton.git
git push -u origin master
# git commands
git clone <url>
git pull origin <branch>
git diff <file>
git status
git add src/ or git add -A
git config --global user.email "shikhil@factweavers.com"
git commit -m'company page'
git stash
git stash apply
git checkout <path>
git checkout -b Temp
git checkout Temp
# Copy file to server machine
scp <file> <username>@<IP address or hostname>:<Destination>
# Copy file in local
scp <file> <user@host:~/>
# Pm2 start with custom name
pm2 start npm --name 'APpnAme' -- start
# compress file
zip -r archive_name.zip folder_to_compress
# Extract files
unzip archive_name.zip
# Change enviurnment
export NODE_ENV=development
# Check env
echo $NODE_ENV
# Check email with repo
git remote -v
# Change email
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
# Executive Summary
$ git push -d <remote_name> <branch_name>
$ git branch -d <branch_name>
Note that in most cases the remote name is origin.
# Delete Local Branch
To delete the local branch use one of the following:
$ git branch -d branch_name
$ git branch -D branch_name