Skip to content

Instantly share code, notes, and snippets.

@sumanssaurabh
Last active July 29, 2018 09:55
Show Gist options
  • Save sumanssaurabh/5ec88d2f3fc4c77d2223be5ac036c3d6 to your computer and use it in GitHub Desktop.
Save sumanssaurabh/5ec88d2f3fc4c77d2223be5ac036c3d6 to your computer and use it in GitHub Desktop.
Git basic cheatsheet
#Basic commands
git init //Initalize Local Git Repository
git add <file> //Add Files to index
git status //check status of working tree
git commit //commit changes in index
#remote commands
git push //push to remote Repository
git pull //pull latest from remote Repository
git clone //clone Repository into new directory
git add . //index all files in directory
git rm --cached <file> // to unstage file working tree
git commit -a -m '' // it will add any new file and commit
git remote add origin https://github.com/sumanssaurabh/chrome.git
git remote add origin [email protected]:username/repo-init.git
git push -u origin master
#Change your remote's URL from SSH to HTTPS with the git remote set-url command
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment