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

Re: Unable to remove a file

From
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Date
Oct 4, 2011, 14:08 UTC
Message-ID
<4E8B135D.8090507@in.waw.pl>
In-Reply-To
<CAAZ43xZo8cyE_ASz1Hc4yYoUjmH1OnVogOj6mtqFzmAUSBptFw@mail.gmail.com>
On 10/04/2011 01:36 PM, robert mena wrote:
Show 6 quoted lines
> Hi John,
>
> I understand that.   For the other that have cloned the repository in
> the past (no one has committed anything locally) is there any special
> procedure to be performed or a simply git fetch/pull will make their
> local repositories in sync?

git fetch updates the remote references, always. If the remote is rebased, as in this case, the only difference is that git fetch's message will be a little bit different.

git pull cannot be used in this case! It would "merge" the old history with the new rewritten history... One should do 'git fetch' and then 'git reset --hard origin/master' or something like that.

- Zbyszek

Show 22 quoted lines
> 2011/10/4 John Szakmeister<john@szakmeister.net>:
>> 2011/10/4 Zbigniew Jędrzejewski-Szmek<zbyszek@in.waw.pl>:
>> [snip]
>>>> git filter-branch --index-filter 'git rm -q --ignore-unmatch --cached
>>>> scripts/\\' HEAD
>>>> Rewrite 5ac83187fa298add60cf81fd1d54b194da7ae783 (57/57)
>>>> Ref 'refs/heads/master' was rewritten
>>>> git push
>>>>   ! [rejected]        master ->    master (non-fast-forward)
>>>> error: failed to push some refs to 'git@myserver:repository'
>>>>
>>>> Should I do anything special?
>>>
>>> git push -f
>>
>> I assume you understand that you're rewriting history Robert, and that
>> has some consequences?  You're master branch is now divergent, since
>> the commit ids changed.
>>
>> -John
>>
>
Previous: robert menaNext: Andreas Schwab
Message 7 of 8 in “Unable to remove a file”
  1. robert menaOct 3, 2011
  2. Andreas SchwabOct 3, 2011
  3. robert menaOct 3, 2011
  4. Zbigniew Jędrzejewski-SzmekOct 4, 2011
  5. John SzakmeisterOct 4, 2011
  6. robert menaOct 4, 2011
  7. Zbigniew Jędrzejewski-SzmekOct 4, 2011
  8. Andreas SchwabOct 4, 2011

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.