Created
January 15, 2020 09:41
-
-
Save iamdeveloper-lopez/a587a545dde6b5c6799550f990c0dd93 to your computer and use it in GitHub Desktop.
Important git commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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