git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: neubyrNext: Nguyen Thai Ngoc Duy
Message 2 of 3 in “tracking file locally without pushing it to remote”
  1. neubyrJul 22, 2011
  2. Nguyen Thai Ngoc DuyJul 23, 2011
  3. Nguyen Thai Ngoc DuyJul 23, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.