git maintenance commands

Sunny Parkash
Aug 24, 2017 · 1 min read

Here are list of my useful commands that I like to run regularly

Clean up merged local branches

I use `git-flow` as to push my changes for review. So for every change results into a branch of its own, so at some points my `git branch` shows a list which is a pain to clean up one by one. Here is command that gets it done in one go.

git branch — merged | egrep -v “(^\*|master|qa|develop)” | xargs git branch -d

Stop/Start tracking changes to you local file

Pause tracking changes to a file

git update-index --assume-unchanged path/to/file

Resume tracking changes a file

git update-index --no-assume-unchanged path/to/file

)

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade