« Back to Index

Git: stage hunks for untracked files in git

View original Gist on GitHub

Tags: #git #patch #staged #untracked

git stage hunks.md

If you’ve created a bunch of new files in git, use git add --intent-to-add (or git add -N) to move the files from untracked to unstaged.

This way you can incrementally stage hunks similar to how you can stage hunks from previously committed files.