Michael
Michael

Reputation: 7809

git stage all files that are already tracked and have a certain extension

As the title says: Is it somehow possible in git to...

The use case is a repo where I often have files that remain untracked (changes too fast to add them to gitignore) and I have some binary data files that I don't want and need to commit after each modification, only occasionally.

So basically I often want to say: "Hey git, stage all already tracked files with extension *.xyz".

Upvotes: 0

Views: 70

Answers (1)

Romain Valeri
Romain Valeri

Reputation: 21908

Simply

git add -u '*.xyz'

( thanks to UnbearableLightness for the insight about -u )

( and mind the quotes )

Upvotes: 2

Related Questions