Skip to content

Instantly share code, notes, and snippets.

View ritchielrez's full-sized avatar
🎯
Focusing

RitchielRez ritchielrez

🎯
Focusing
  • Oshawa, Canada
  • 14:51 (UTC -04:00)
View GitHub Profile
@ritchielrez
ritchielrez / gist:30690940ae25e3ccdf17ac8cd1fe985a
Created May 17, 2025 22:48 — forked from CrookedNumber/gist:8964442
git: Removing the last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

local wezterm = require("wezterm")
local config = wezterm.config_builder()
local act = wezterm.action
config.default_prog = { "bash" }
config.color_scheme = "Catppuccin Mocha (Gogh)"
config.window_decorations = "RESIZE"
config.window_close_confirmation = "NeverPrompt"
config.window_background_opacity = 0.8
config.win32_system_backdrop = "Acrylic"
@ritchielrez
ritchielrez / swappiness.md
Created November 13, 2023 10:33 — forked from docapotamus/swappiness.md
Setting swappiness on Debian

Swappiness controls the tendancy the kernel wishes to swap.

Even with free memory the kernel may swap.

100 means aggressively swap 0 means wait until the last minute to swap

To check current swappiness cat /proc/sys/vm/swappiness

@ritchielrez
ritchielrez / delete_git_submodule.md
Created November 12, 2023 13:19 — 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
{
"background" : "#282828",
"black" : "#665C54",
"blue" : "#7DAEA3",
"brightBlack" : "#928374",
"brightBlue" : "#7DAEA3",
"brightCyan" : "#89B482",
"brightGreen" : "#A9B665",
"brightPurple" : "#D3869B",
"brightRed" : "#EA6962",