From: Parag Kalra <paragkalra@gmail.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Making Git untrack few folders
Date: Sun, 12 Sep 2010 13:00:17 -0700 [thread overview]
Message-ID: <AANLkTi=5_u+Ei-3+9uUYcv5bkrpGCuibMiOW-_N6H8tb@mail.gmail.com> (raw)
In-Reply-To: <20100912103717.GA24576@kytes>
Thanks Ram.
git rm --cached was precisely what I was looking for.
Also .gitignore file worked without any issues.
Cheers,
Parag
On Sun, Sep 12, 2010 at 3:37 AM, Ramkumar Ramachandra
<artagnon@gmail.com> wrote:
> Hi Parag,
>
> Parag Kalra writes:
>> 1. Is there a way I can make Git not track a particular folder in my
>> working code base directory. For example, I have a tmp folder in my
>> local code base and I don't want Git to track whats going on inside
>> that directory.
>
> Yes. See gitignore (5).
>
>> 2. Accidently I have added this folder, committed and pushed it to
>> origin master. Is there a way I can remove this tmp folder from git
>> revision history and at the same time keeping it intact in my local
>> code base directory.
>
> Yes. Simply `rm --cached` the folder, and amemd your previous commit
> using `commit --amend`, and perform a non-ff push using the `+`
> syntax. For example, to perform a non-ff push to remote branch `foo`
> whose local name is `foo`, invoke `push +foo:foo`. Note that other
> users who have already pulled the bad commit will have to forget about
> it explicitly too.
>
> If the folder tracking information is a few revision deep, consider
> using `rebase -i` to manually overwrite those commits to exclude that
> folder. If the folder was too many revisions earlier, use a
> `filter-branch` index filter to make Git completely forget that
> folder.
>
> -- Ram
>
prev parent reply other threads:[~2010-09-12 20:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTi=vjueuP66BAMsRDww=J3Nq3Q4BooKF+85khcBn@mail.gmail.com>
2010-09-12 10:22 ` Making Git untrack few folders Parag Kalra
2010-09-12 10:37 ` Ramkumar Ramachandra
2010-09-12 20:00 ` Parag Kalra [this message]
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='AANLkTi=5_u+Ei-3+9uUYcv5bkrpGCuibMiOW-_N6H8tb@mail.gmail.com' \
--to=paragkalra@gmail.com \
--cc=artagnon@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).