Skip to content

Instantly share code, notes, and snippets.

@iamdeveloper-lopez
Created January 15, 2020 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamdeveloper-lopez/a587a545dde6b5c6799550f990c0dd93 to your computer and use it in GitHub Desktop.
Save iamdeveloper-lopez/a587a545dde6b5c6799550f990c0dd93 to your computer and use it in GitHub Desktop.
Important git commands
# rm all files
git rm -r --cached .
# add all files as per new .gitignore
git add .
# now, commit for new .gitignore to apply
git commit -m ".gitignore is now working"
Delete uncommited items in branch
git reset --hard
Delete latest commit to selected branch
git reset --hard HEAD
Delete latest number of commit depends on number you put in N
git reset --hard HEAD~N
Listing of remote setup in git local
git remote -v
Delete existing remote to your setup git local
git remote -rm <name of remote>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment