Skip to content

Instantly share code, notes, and snippets.

View fieldse's full-sized avatar

Matt fieldse

View GitHub Profile
@fieldse
fieldse / grep_match_count.sh
Created November 15, 2020 10:13
Grep/zgrep: count matches across multiple files
# Count occurences of KEYWORD across all files named [something].log
# Flag: -src
# Credit:
# https://superuser.com/questions/205591/show-the-matching-count-of-all-files-that-contain-a-word
grep -src KEYWORD *.log
# Example output:
# production.20201107.log:12
@fieldse
fieldse / git-reset-hard-to-master.md
Last active October 18, 2023 09:32
How to perform a hard reset of a git branch to master

Git - Hard reset branch to current master

Scenario

  • You have Git branches main and branch staging.
  • You need to reset staging exactly to the state of branch main.

Warnings

Be sure you really want to do this: