Useful Git tips

github-mark

Apply .gitignore on already pushed repository

$ git rm -r --cached .
$ git add .
$ git commit -m '.gitignore applied'

 

Disconnect local repository from remote

$ git remote rm origin

 

Reset to specific commit

$ git reset --hard <commit>

 

Remove all untracked files and directories

$ git clean -f -d

 

Leave A Comment

Your email address will not be published. Required fields are marked *