Howto prevent git from pushing changes to some files
I've cloned a subversion repository using git svn. The source has some config fi开发者_如何学Cles that i have to edit to fit my system. I would like to store my changes to those files in my local repo (to easily switch between branches without worrying about locally modified files) but i would like to prevent those changes to be pushed to the remote repository.
Can anybody help me?
Thanks in advance.
About a year ago I wrote git-overlook, which I now realize is a hunk-based git-ignore. It's alpha-software and does not have all the features I want, but perhaps what you're looking for.
Can't you just put those files in .gitignore
and use the rest of the repo as is? I think it should work. Or do you want the files to be version controlled locally but just not pushed? I'm not sure if that's possible since it's changes that get pushed rather than files.
If you already have a .gitignore in the repo, you can alter your local git config to use another exclude file in which you exclude the files you want to (git help gitignore) for details. Would that work?
精彩评论