Skip to main content

Git Quickie: Skip Tracking

Remove specific change from git tracking

Published 1 min readMarkdown
Part of seriesGit Quickies
Git Quickie: Skip Tracking

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!

About the author

  • 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.

No comments yet. Be the first to comment.

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 nextGit Quickie: Branch ComparisonGet simple list of changed files