git

Remove a git submodule

Using git-submodule is include code can be very useful, however it doesn't have a particularly easy method of removing it in the even you change your mind on including another project's entire git history in your own.

There are a number of manual steps to get the process done and the project removed.

This has since been simplified into the following which removes the submodule from .gitmodules and the working directory.

Remove a file from all git history

This will revise the entire git repo history to remove a file that has been accidentally included. eg. API or SSH keys.

Stop git from pushing a local secret branch

Git will end up pushing every branch to remote at some point. If you have a branch that should only remain local and never be pushed, it can be singled out so that it simply cannot be pushed.

NB: This does not stop a fork of the branch from being pushed, only the specifically named branch.

git config branch.[branch not to allow].remote no_push

Subscribe to RSS - git