Question: I have a git repository on my local computer with many, about 10, branches. In the root directory of this repository there is a folder that is currently not tracked in any branch. I want to now start tracking this. If I do `git add foldername/*` and then `git commit` it will add the folder only to the current branch. Can I use a git command so that the folder is added to all the branches, without manually checking out each branch and adding the folder to that branch? If it is relevant, I want to state that there are a couple of files (not related to the above folder) that are different in each branch and I want to keep it that way. That is, the command you suggest should leave the other files untouched. 

Thanks in advance for your help.

Answer: 
There's no simple way to do this. The only way to achieve it would be to add the folder individually to each of the 10 branches, or add it to one folder and merge that commit individually into each of the other branches.
reset instead of checkout will do exactly what you want, zero checkouts, nothing touched in the worktree

```
# from a worktree with nothing staged
for b in `git branch|sed s/.//`; do
    git reset $b
    git add folder
    git commit -m'add folder'
done
git reset where_you_were_before

```