Git commit error message: cannot open (previously deleted source file)

Every time I do something in this git repository, I get a message (apparently harmless) about mentioning several files that no longer exist:

$ git commit -a
error: Could not open cssrc/csgrpc/Main.cs
error: Could not open cssrc/csgrpc/Main.cs
Recorded preimage for 'cssrc/csgrpc/Main.cs'
... more 3-line groups like one above ...
[x017-upgrade a86861b] Point Audio to new location of....
 1 file changed, 1 insertion(+), 1 deletion(-)

The files were originally part of the subtree supported by git subtree -P cssrc ..., and I deleted them during the conflict git subtree pull, as they are no longer needed in this project (but were modified earlier and fixed, therefore, the conflict).

Files really were not found either in the index or on the working line:

$ git ls-files -cs | grep Main.cs
$ find -name 'Main.cs'
$

The parameter is rerere.enabledset to true. Is this a criminal? Where is the pointer to these file names stored? How to clean it?

+4
source share
1 answer

git rerere . " ( ) git subtree pull conflict", git "" . git rerere . , rerere, git , . , , git , . , git ; , , , , . , , /.

git rerere, git .

, , ( , ) , . , , , .

, ...

  • $ mkdir test_rerere
  • $ cd test_rerere
  • $ git init
  • $ cd .git
  • $ mkdir rr-cache
  • $ cd ..
  • hello.rb

    #! /usr/bin/env ruby
    
    def hello
      puts 'hello world'
    end
    
  • $ git commit -a -m"added hello.rb"
  • goodbye.rb

    #! /usr/bin/env ruby
    
    def bye
      puts "goodbye world"
    end
    
  • $ git commit -m"added goodbye.rb"
  • $ git branch i18-world
  • hola hello.rb
  • $ git commit -a -m"changed hello to hola in hello.rb"
  • $ git checkout i18-world
  • mundo hello.rb
  • $ git commit -a -m"changed world to mundo in hello.rb"
  • adios goodbye.rb
  • $ git commit -a -m"changed goodbye to adios in goodbye.rb"
  • $ git checkout master
  • mundo goodbye.rb
  • $ git commit -a -m"changed world to mundo in goodbye.rb" , , . , , .
  • $ git status

    On branch master
    nothing to commit, working tree clean
    
  • $ git merge i18-world
  • - ...

    Auto-merging hello.rb
    CONFLICT (content): Merge conflict in hello.rb
    Auto-merging goodbye.rb
    CONFLICT (content): Merge conflict in goodbye.rb
    Recorded preimage for 'goodbye.rb'
    Recorded preimage for 'hello.rb'
    Automatic merge failed; fix conflicts and then commit the result.
    
  • , rerere ... .
  • $ git rerere status goodbye.rb hello.rb, . git rerere diff git ls-files -u .
  • hello.rb hola mundo , $ git rm goodbye.rb. . $ git status, , goodbye.rb ( git ), hello.rb .
  • $ git commit -a -m"HUH?"
  • , , , , , , , , , , .
  • $ git log --oneline --decorate --graph --all, .
  • hello.rb 'hola mundo' 'hola chica bonita!'
  • $ git commit -a -m"changed 'hola mundo' to 'hola chica bonita!' in hello.rb"
  • , , .
  • $ git rerere status goodbye.rb, .
  • $ git rerere diff , goodbye.rb .
  • $ git log --oneline --decorate --graph --all
  • , , git status git rerere status . , goodbye.rb .
  • , , . , , " adios goodbye.rb". ( hello.rb) $ git checkout **yoursha1** goodbye.rb.
  • , hello.rb . "hola chica bonita!".
  • BIG FIX! git rerere... Ta Da! , git "goodbye.rb".
  • , , ! , ... , , . , - . , goodbye.rb , , , , goodbye.rb . , .
  • , , .
  • $ git checkout i18-world
  • $ git rebase master
  • $ git status nothing to commit, working tree clean
  • $ ls "hello.rb", , goodbye.rb.
  • $ git log --oneline --decorate --graph --all .
  • $ git rerere status , ( ).
  • $ cat hello.rb

    #! /usr/bin/env ruby
    
    def hello
      puts 'hola chica bonita!'
    end
    
  • hello.rb 'hola chica bonita!' 'hola chica bonita! te amo '.
  • $ git commit -a -m"updated hello in hello.rb to say 'hola chica bonita! te amo"
  • git log --oneline --decorate --graph --all, , i18- .
  • $ git checkout master
  • $ git merge i18-world
  • $ git branch i18-world *master
  • $ git branch -d i18-world

, . , - , "goodbye.rb" , !

, , , , , ( , ) .

+3

Source: https://habr.com/ru/post/1662752/


All Articles