How to permanently prevent specific part of a file from being committed in git?

Posted by boutta on Stack Overflow See other posts from Stack Overflow or by boutta
Published on 2012-06-20T08:43:02Z Indexed on 2012/11/21 5:00 UTC
Read the original article Hit count: 173

Filed under:
|
|

I have cloned a remote SVN repository with git-svn. I have modified a pom.xml file in this cloned repo in a way that the code compiles. This setup is exclusive for me. Thus I don't want to push the changes back on the remote repo.

Is there a way to prevent this (partial) change of a file from being committed into the repo? I'm aware of the fact, that I could use a personal branch, but this would mean certain merging overhead. Are there other ways?

I've looked into this question and this one, but they are for rather temporal changes.

Update: I'm also aware of the .gitignore possibilities, but this would mean to exclude the file completely.

© Stack Overflow or respective owner

Related posts about git

Related posts about git-svn