Is it possible to keep .gitignore files out of SVN?

I’m using git svn to merge changes from my local git repository to an SVN server. However, when I issue git svn dcommit it will actually commit any .gitignore files that I have in my source tree. This is even after I’ve checked out the SVN repository locally (using SVN), set the svn:ignore property (recursively, listing .gitignore as one of the files to ignore), and then committing that property change directly to SVN.

Is this intended behaviour? A bug? Is there a work around that anyone knows of to keep .gitignore out of SVN?

  • Pull remote branch into local repo with different name?
  • how can i version a java application between builds?
  • git clone timed out when used through https proxy
  • What exactly do button “Abandon Change” in gerrit?
  • vim syntax highlighting for git commit messages - custom commentchar
  • Remove 4 commits from my git history
  • I just know a non-git user on my team is going to see these files and start deleting them, then the next time I go to rebase/dcommit a lot of unwanted files are going to wind up in SVN.

  • Is there any way to get git to work directly with a .pac (proxy auto-config) script?
  • Break up multiple changes into separate commits with git?
  • What do I do when a pull request is cherry picked?
  • Hash collision in git
  • Git Merge without removing the other branch to pull the changes
  • How to setup GIT bare HTTP-available repository on IIS-machine
  • One Solution collect form web for “Is it possible to keep .gitignore files out of SVN?”

    You can use Git’s repo-specific “exclude” file, instead of using .gitignore files. The “exclude” file resides at $GIT_DIR/info/exclude (where $GIT_DIR is the Git repository directory, usually .git). The format of this file is exactly the same as that of .gitignore files. The difference is that this is a repository-specific file — it will only exist in your repository. It will not be propagated to any other repositories (e.g. via git clone or git svn dcommit).

    There is no way to omit .gitignore files from the SVN repo, but keep them in Git. Any attempt to do so would result in your local commits not matching the commits that git-svn retrieves from the SVN server. In other words, your local repository’s history would not be reconcilable with the history from SVN; they would be permanently out-of-sync.

    Git Baby is a git and github fan, let's start git clone.