Re: tracking file locally without pushing it to remote
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Jul 23, 2011, 12:27 UTC
- Message-ID
- <CACsJy8BZSWaaNPjQYKXmTHvJ5vbNXBfNCtV78DUJVDuPqtp1Hg@mail.gmail.com>
- In-Reply-To
- <CALFxCvzqGBbq0fqtLJdwTideh9Un-cAEeQi8WpC496qoyCLg4w@mail.gmail.com>
On Sat, Jul 23, 2011 at 2:23 AM, neubyr <neubyr@gmail.com> 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 <command>
Create some aliases to shorten the commands. Branch switching will be a problem, since you have to switch branch on two repositories consistently.
-- Duy