On Fri, 27 Sep 2013 00:53:21 -0700 (PDT)
Mauro Sanna <mrsan...@gmail.com> wrote:

> When I push my commits I see target and its subdirs in the repository.
> But target is gitignored, why is it pushed?

There are several misunderstandings here:

1) Mechanisms for ignoring files in Git have nothing to do with pushing
   and fetching: these operations manipulate existing commits and
   references pointing at them.

   It's index updates (`git add`) and, in certain cases, work tree
   oprtations (`git rm`, `git clean` etc) which consider ignore lists
   (so that, say `git add '*'` won't add auto-built cruft added to
   an ignore list).

2) Mere updating of a branch in a remote repo does not do anything
   to "the subdirs in the repository" because such "subdirs" only
   occur in the work tree of a non-bare repository, and the push
   operation is not concerned about the work tree (short of respecting
   the receive.denyCurrentBranch configuration variable which forbids
   updating of a branch which is currently checked out in a non-bare

   So it might be that if you actually *deleted* already tracked
   unwanted files and recorded a commit which does not contain them
   anymore and then arranged for them to be excluded by the Git file
   ignoring mechanism, and then updated a remote branch with your
   commit, you now need to actually update your work tree to the new
   state of the updated branch -- for instance, by doing

   git reset --hard

   in the work tree (provided the updated branch is what is currently
   checked out, -- otherwise a mere `git checkout <that_branch>` would

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to