Untrack all files on git

17,508

Solution 1

Even simpler:

cd /root/directory/of/your/local/repo
git rm --cached -r .
                  ^^^
               (space - dot)

Even even simpler:

git clone url/for/Kohana /different/local/path

Solution 2

git rm --cached File

Will delete the file in the index, so it will no longer be tracked, but won’t physically delete it. This will untrack the file only for current branch

[OR]

Use this git command. After you do this, git stops checking the file for possible modifications.

git update-index --assume-unchanged  <filename>

At any time, you can track again by setting --no-assume-unchaged flag

git update-index --no-assume-unchanged  <filename>

But these command do not affect the remote repository.

Share:
17,508
Jacob
Author by

Jacob

Updated on June 12, 2022

Comments

  • Jacob
    Jacob almost 2 years

    In the move from C9 to hosting on my Macbook via SSH, I've had to re-download Kohana and change some other things just to get my site working; I don't want those to be committed. Is there any way to untrack all tracked files so only future changes are committed? Or is there something else I should be doing?

    I'm on a Macbook running Mountain Lion with Apache and PHP turned on.

  • VonC
    VonC over 5 years
    @VictorR.Oliveira Agreed. I have edited the answer to emphasize that part of the command.
  • João Ignacio
    João Ignacio over 4 years
    I needed to untrack all the files in my project and to track them again. So I used 'git rm --cached -r .' (don't forget the dot(.) in the end)