Hi Alexander,

Aha, I see. No, keeping a certain set of files from being merged is not 
possible in any straight forward way. It is usually a sign that your code 
does not have quite the right structure for its task. Basically, code that 
you don't want to be merged along with the rest of your changes should 
somehow be kept outside the current Git repository.

Let's say your project is called "funky", and you want to keep the code 
excluded from merging in a separate repo called "funky-private":

├── funky
│   └── stuff.txt
└── funky-private
    └── TODO.txt

Once you get your "private code" (that is, your TODO.txt) file into 
"funky-private", you can pick some way of including it into the first one 
during development, build, or run-time like this:

├── funky
│   ├── private -> ../funky-private
│   │   └── TODO.txt
│   └── stuff.txt
└── funky-private
    └── TODO.txt

Either use some way of linking in the 
copy it in using some script, and then ignore this folder (here called *
private*) in funky/.gitignore.

Or use submodules as suggested in that thread on stackoverflow you 
mentioned. It depends on your workflow, and what you persona preferences.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to