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: 
Branches are made to be treated separatly until you merge them. However, if you really don't want to do it manually, you can use some refinement of the following script:

```
$ git checkout master
$ git add foldername
$ git commit -am "Adding foldername"
$ for i in `git branch`; do git checkout $i && git cherry-pick master; done

```
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

```