git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniele Segato <daniele.bilug@gmail.com>
To: git@vger.kernel.org
Subject: previously committed file untracked prevent checking out an old  tag/branch
Date: Fri, 11 Sep 2009 13:26:35 +0200	[thread overview]
Message-ID: <9accb4400909110426v2a42086ema318167e94b2cbc1@mail.gmail.com> (raw)

Hi,

I had this situation:

we used to have a properties file in our project that was used by ant
to build it.
That file was tracked since the beginning of the project (several months ago).

let's call it:
build.properties

(the project is on SVN and I'm the only one to use git)

Since everyone in the project has different directories paths I
decided to untrack the file
create a new template file and track it instead:

so I did something like this:

cp build.properties build.properties.template
vim build.properties.template
echo build.properties >> .git/info/exclude
git rm --cached build.properties
git add build.properties.template
git commit -m "finally we don't overwrite it each other anymore"

Now I had to switch back to a tag that still have that file
(build.properties) tracked to fix some
issue there but when I try I get:

error: Untracked working tree file 'build.properties' would be
overwritten by merge.

How would you handle a situation like this?

I only can think of doing a backup of my build.properties, delete it
and check out the tag or I just delete it and rebuild
it from the template later.

I did it but that made me think on it.

Actually what I really wanted here was the possibility to "locally
track" that file...

something like
git local <file>

that will have that file indexed by git so I can switch to branch that
have that file without loosing it when I go back.
furthermore that would allow me to keep versions of my local file even
if I don't want to commit it.
I could see if I accidentally modified it.

This could be useful, in my opinion.

Is there on git a feature to do something like that?
Do you think it could be useful or do you see any possible problem about that?

Regards,
Daniele

             reply	other threads:[~2009-09-11 11:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 11:26 Daniele Segato [this message]
2009-09-12  0:06 ` previously committed file untracked prevent checking out an old tag/branch Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9accb4400909110426v2a42086ema318167e94b2cbc1@mail.gmail.com \
    --to=daniele.bilug@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).