DEV Community

Discussion on: People rarely use complicated git commands on the weekend, and I have the data to prove it.

Collapse
 
aaronsmulktis profile image
Smokey • Edited

Lets turn this thread into a sharing shower and swap git commands:

Here's my favorite by far:

git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch .idea" \
--prune-empty --tag-name-filter cat -- --all

So in many cases, you accidentally committed your secrets or personal config into the app way too early on. Here's what that command does to help:

  • searches every branch & commit for the .idea file
  • deletes any trace of that file from every branch & commit
  • then just git push origin --all --force to overwrite your remote history
  • tell your mates to git fetch origin