Useful Git tips


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


Install submodules in .gitmodules

$ git submodule update --init --recursive



Leave A Comment

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