I have a file which contains sensitive datas so I don\'t want to push content of this file to remote server.
To achiev
You can enable sparse checkout and add the file there together with adding the skip-worktree flag (if you add the sparse checkout alone it probably will be deleted).
To exclude a file you should put to sparse-checkout file (see git-read-tree manual):
/*
!unwanted
Then it will not be touched at update (so you don't get content of the other branch there, instead preserving your edits). It might be not what you want.