How to add a file to the home directories of all existing and future users

Solution 1:

Yo will need to use two procedures , first for already created accounts :

http://www.cyberciti.biz/tips/linux-unix-shell-batch-copy.html

and another one for future users :

http://linuxers.org/howto/how-set-default-content-new-users-home-directory-using-etcskel

Solution 2:

It'll be easier if users and nodes that need to have git are managed by puppet:

class git {
  packakge { "git":
    ensure => installed,
  }
}

class users {
  user { ... }
  file { "/home/${user}/.gitconfig":
    ensure => present,
    content => template("gitconfig"),
    require => Class["git"],
  }
}

Then for each git node, include class git.