Uploaded April 2026 | Updated September 2026, 2 weeks ago
Ever added console.logs, mocked some data, or disabled a feature temporarily —
then accidentally committed it? Yeah, we've all been there.
In this video, I show you git skip-worktree, a command that tells git to
ignore local changes to a specific file without adding it to .gitignore.
Perfect for:
- Temporary debug logs
- Mocking data during development
- Disabling features while testing your own
Commands used:
# Ignore local changes to a file
git update-index --skip-worktree src/app.jsx
# Start tracking it again
git update-index --no-skip-worktree src/app.jsx
# See which files are currently skipped
git ls-files -v | grep ^S
Subscribe to My Channel: bit.ly/deeecode
Ever added console.logs, mocked some data, or disabled a feature temporarily —
then accidentally committed it? Yeah, we've all been there.
In this video, I show you git skip-worktree, a command that tells git to
ignore local changes to a specific file without adding it to .gitignore.
Perfect for:
- Temporary debug logs
- Mocking data during development
- Disabling features while testing your own
Commands used:
# Ignore local changes to a file
git update-index --skip-worktree src/app.jsx
# Start tracking it again
git update-index --no-skip-worktree src/app.jsx
# See which files are currently skipped
git ls-files -v | grep ^S
Subscribe to My Channel: bit.ly/deeecode










