git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Parag Kalra <paragkalra@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Making Git untrack few folders
Date: Sun, 12 Sep 2010 16:07:20 +0530	[thread overview]
Message-ID: <20100912103717.GA24576@kytes> (raw)
In-Reply-To: <AANLkTiktMe190OVPrTXMtmfaLRLXeJBZ4vSZewJecQWe@mail.gmail.com>

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

  reply	other threads:[~2010-09-12 10:39 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 [this message]
2010-09-12 20:00     ` Parag Kalra

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=20100912103717.GA24576@kytes \
    --to=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=paragkalra@gmail.com \
    /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).