Useful Commands

Afzal Zubair
1 min readSep 14, 2020

npm i create-react-app -g
npm i create-next-app -g
npm i create-next-app -g
npm i create-react-app -g
npm list -g — depth 0

Git Commands

git init
git remote add {name-of-remote-repo} <URL-of-remote-repo>
Example: git remote add origin https://github.com/username/abc.git
git add —all
git commit -m ‘Commit message’
git pull {name-of-remote-repo} {branch-name}
Example: git pull origin master
git push [-u] {name-of-remote-repo} {branch-name}
Example: git push -u origin master
git branch -a
git branch
git branch {newBranch}
git checkout {master/anyBranch}
git remote -v
git remote rm {name-of-remote-repo: example origin}
Example: git remote rm origin

For pushing to a different GitHub account from the same computer

Use HTTPS:

change remote url to https:

git remote set-url origin https://USERNAME@github.com/USERNAME/PROJECTNAME.git

and you are good to go:

git push

To ensure that the commits appear as performed by USERNAME, one can setup the user.name and user.email for this project, too:

git config user.name USERNAME
git config user.email USERNAME@example.com

--

--