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

Re: git has modified files after clean checkout

From
David Aguilar <davvid@gmail.com>
Date
Dec 31, 2008, 23:41 UTC
Message-ID
<402731c90812311541v28ac9617ge52e0e5c0f1298d2@mail.gmail.com>
In-Reply-To
<81bfc67a0812311223g2b6e8476y84b23c19977dfd10@mail.gmail.com>
On Wed, Dec 31, 2008 at 12:23 PM, Caleb Cushing <xenoterracide@gmail.com> wrote:
> here's what I did
>
> rm -r portage
> git clone git@github.com:xenoterracide/portage.git
Here's the anonymous clone URL (the one you provided is private)
    $ git clone git://github.com/xenoterracide/portage.git
Read on below...
Show 25 quoted lines
> cd portage
> git checkout origin/regen2 -b regen2
> git status
>
> # On branch regen2
> # Changed but not updated:
> #   (use "git add <file>..." to update what will be committed)
> #
> #       modified:
> x11-themes/metacity-themes/files/metacity-themes-1.0-gentoo.diff
> #       modified:
> x11-themes/metacity-themes/files/metacity-themes-1.2-gentoo.diff
> #
> no changes added to commit (use "git add" and/or "git commit -a")
>
> why are there files claiming to be modified? this is a clean clone.
> I've had this before I usually end up doing a git reset --hard HEAD,
> but I'm thinking it's a bug, since I've seen it vary on the same clone
> and sometimes even disappear.
>
> git version 1.6.0.6
> --
> Caleb Cushing
>
> http://xenoterracide.blogspot.com
I followed the steps above and did not run into any such issues.

$ git status # On branch regen2 nothing to commit (working directory clean)

$ git version git version 1.6.1.28.gc32f76 (Junio's latest master at the moment)

Here's my quick guess based on what I'm seeing --

The files you mention contain CRLF. Do you have core.autocrlf set globally somewhere, perhaps in your ~/.gitconfig?

It's possible that the autocrlf stuff is messing with those files. They seem to be a mix of both unix LF and CRLF (the CRLF stuff doesn't start until line 104 of x11-themes/metacity-themes/files/metacity-themes-1.0-gentoo.diff, for example, which is kinda odd but maybe be intentional?)

Check your autocrlf settings. The following commands print out nothing for me:

    $ git config core.autocrlf
    $ git config --global core.autocrlf

Anyways.. like I said -- I couldn't reproduce your problem so this is pure speculation on my part =)

Good luck,
-- 
    David
Previous: Caleb CushingNext: Caleb Cushing
Message 2 of 6 in “git has modified files after clean checkout”
  1. Caleb CushingDec 31, 2008
  2. David AguilarDec 31, 2008
  3. Caleb CushingJan 1, 2009
  4. Thomas RastJan 1, 2009
  5. Caleb CushingJan 2, 2009
  6. Caleb CushingJan 5, 2009

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.