From: Nguyen Thai Ngoc Duy Date: Sat, 23 Jul 2011 12:27:20 GMT Subject: Re: tracking file locally without pushing it to remote Message-ID: In-Reply-To: On Sat, Jul 23, 2011 at 2:23 AM, neubyr wrote: > I have two configuration files in a project which I would like to > track locally, however avoid pushing them to the remote repository. Is > it possible do that? Any suggestions on how can it be done? Manage the configuration files in a different repository (but with the same working tree). Git does not support sharing worktree this way, so it's a bit inconvenient. Maybe other people can give more suggestions. # Initialize a config repo, place it at $GIT_DIR/config.git so it's hidden GIT_DIR=`git rev-parse --git-dir`/config.git GIT_WORK_TREE=/path/to/worktree git init # Work on all files as usual, when you need to commit config files GIT_DIR=`git rev-parse --git-dir`/config.git git Create some aliases to shorten the commands. Branch switching will be a problem, since you have to switch branch on two repositories consistently. -- Duy