Skip to content

Instantly share code, notes, and snippets.

View Denisss025's full-sized avatar
๐Ÿ‘๏ธโ€๐Ÿ—จ๏ธ
I'm watching you!

Denis Denisss025

๐Ÿ‘๏ธโ€๐Ÿ—จ๏ธ
I'm watching you!
  • GARANT
  • Moscow, Russian Federation
View GitHub Profile
@Denisss025
Denisss025 / delete_git_submodule.md
Created September 12, 2018 11:29 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
// Navigation
w // move to the end of a word
b // move to the beginning of a word
% // go to matching bracket
0 // go to beginning of line
$ // go to end of line
{ // move down by a block
} // move up by a block
gg // move to the top of the file
G // move to the bottom of the file