Skip to main content

Command Palette

Search for a command to run...

Git Quickie: Skip Tracking

Remove specific change from git tracking

Published
1 min read
Git Quickie: Skip Tracking
D

Software Engineer with passion in frontend who specializes in Angular but doesn't hesitate to check on other sides - configuring CI/CD, clouds, backend and API, mobile development using Flutter, and so on.

Many credentials are accidentally committed to different git repositories (GitHub, GitLab, etc.), which reduces app security as anyone can scan public repo for some common files/variables with credentials.

To avoid this, we usually use .gitignore but sometimes there could be corner cases. For example, we've got the .npmrc file with the predefined field for using of token to access private registries. And file with that placeholder is committed to source control.

So what can we do to not commit private tokens accidentally? There is another one-line command for this:

git update-index --skip-worktree .npmrc

What are your favorite git commands? Please, don't hesitate to share them in the comments section!

Git Quickies

Part 2 of 3

In this series I'll be sharing some quick git commands that could be useful from time to time

Up next

Git Quickie: Changelog

Quick git command to generate simple changelog