No. gitignore can only filter on a file basis. ...
Since you are talking about a <div> that is changed, I think you push the whole tiddlywiki.html file. .. So the only thing that can prevent this is, that you change your "save-filter" in TW itself. The tiddler is
$:/core/save/all If you change it like the following code, it won't save eg: $:/StoryList, ... but there are a lot of other temporary tiddlers, that may be created while working with TW. So may need them to the "exclude" list.
WARNING! -> !!! Make a backup first !!! If you mess up this tiddler you may end up with an
empty or corrupted tiddlywiki!
\define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] -[[$:/StoryList]] -[prefix[$:/temp/]] -[prefix[$:/state/]] $(publishFilter)$
\end
{{$:/core/templates/tiddlywiki5.html}}
I did add the following
-[[$:/StoryList]] -[prefix[$:/temp/]] -[prefix[$:/state/]] elements to the above filter. It will prevent the story list and all tiddlers prefixed "$:/temp/" and "$:/state/". .. If you don't want this, just remove them. ... Just to be sure: Did I make clear that
backups are important? ;)
There is a
$(publishFilter)$ variable, which should make things easier, but I don't know how to set it. @Jeremy can you help?
have fun!
mario
PS: A wise man said: Backups will prevent you from data loss! ;)