All of lore.kernel.org
 help / color / mirror / Atom feed
* Unable to remove a file
@ 2011-10-03 14:21 robert mena
  2011-10-03 16:04 ` Andreas Schwab
  0 siblings, 1 reply; 8+ messages in thread
From: robert mena @ 2011-10-03 14:21 UTC (permalink / raw)
  To: git

Hi,

I had a file called \ under a directory scripts.  I've removed,
committed, pushed to the server BUT my windows clients when they try
to clone I stop because of this.

Don't ask me why and it is probably windows/the IDE fault but I have
to solve it.

I found the command filter but it is not working.

git filter-branch --index-filter 'git rm --cached scripts/\\' HEAD
Rewrite b75a1a3af45a4d82fcfe7a6148fc4d6e1c55ee91 (1/48)rm 'scripts/\'
Rewrite 8a32d6194e9c46dc0f1ce60a2245fcbcd7c12d00 (2/48)rm 'scripts/\'
Rewrite 892bba8bd7563186d7b1c493cf05d8823cfe2f7b (3/48)rm 'scripts/\'
Rewrite 0be74d8143f670b08806510dd09cf77029f57bcb (4/48)rm 'scripts/\'
Rewrite ec7e45a5d8100b7a1e49ca8d0cf5ec5d638f2dd7 (5/48)rm 'scripts/\'
Rewrite c9dde5bf86391a66f80dc86bcc3078c78866b5da (6/48)rm 'scripts/\'
Rewrite 499be785b2538a1d6b382e1a0d6e9bdc8a771a76 (7/48)rm 'scripts/\'
Rewrite 327ac340d4dee02bc2bfed07bd94df5f87b8036c (8/48)rm 'scripts/\'
Rewrite 5ae256edce2959585b2819c4d6d0d4704b02984a (9/48)rm 'scripts/\'
Rewrite 3811ef08c5a2be9f4f049c50caf501944483ec72 (10/48)rm 'scripts/\'
Rewrite 52b3de12d3cde4f6bb920d335fe8629d368d965b (11/48)rm 'scripts/\'
Rewrite ff115cd8f3213d8218d369361d5ee77010081c22 (12/48)rm 'scripts/\'
Rewrite d28c02b462e8ee70c6d516d7d2c6754b82bfc80e (13/48)rm 'scripts/\'
Rewrite 173aecfa81f64644747934f815befb8f83daf6ce (14/48)rm 'scripts/\'
Rewrite d4649a98584c25c1c8d52adbd49d822c961dc7cb (15/48)rm 'scripts/\'
Rewrite d026354566abc0d135cdd3838fa96055baa29a03 (16/48)rm 'scripts/\'
Rewrite 9f7869cf30bc0c04e072859bfbc1325758a5e893 (17/48)rm 'scripts/\'
Rewrite 6058b6d0b783cd290ce78e344f442d161989b72d (18/48)rm 'scripts/\'
Rewrite 7f7842d461a645223e39d5b6c451ec8b3e8f89a4 (19/48)rm 'scripts/\'
Rewrite 11f9ad3c22746e4fddb407790eb0db4db709902d (20/48)fatal:
pathspec 'scripts/\' did not match any files
index filter failed: git rm --cached scripts/\

How can I really delete this without having to start from scratch?  I
won't hold my breath for windows or even the IDE's to detect this and
solve it.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to remove a file
  2011-10-03 14:21 Unable to remove a file robert mena
@ 2011-10-03 16:04 ` Andreas Schwab
  2011-10-03 20:57   ` robert mena
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2011-10-03 16:04 UTC (permalink / raw)
  To: robert mena; +Cc: git

robert mena <robert.mena@gmail.com> writes:

> I found the command filter but it is not working.
>
> git filter-branch --index-filter 'git rm --cached scripts/\\' HEAD

$ git filter-branch --index-filter 'git rm -q --ignore-unmatch --cached scripts/\\' HEAD

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to remove a file
  2011-10-03 16:04 ` Andreas Schwab
@ 2011-10-03 20:57   ` robert mena
  2011-10-04  7:57     ` Zbigniew Jędrzejewski-Szmek
  0 siblings, 1 reply; 8+ messages in thread
From: robert mena @ 2011-10-03 20:57 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: git

Thanks.

It accepted the command but rejected my push.

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?

On Mon, Oct 3, 2011 at 12:04 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> robert mena <robert.mena@gmail.com> writes:
>
>> I found the command filter but it is not working.
>>
>> git filter-branch --index-filter 'git rm --cached scripts/\\' HEAD
>
> $ git filter-branch --index-filter 'git rm -q --ignore-unmatch --cached scripts/\\' HEAD
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to remove a file
  2011-10-03 20:57   ` robert mena
@ 2011-10-04  7:57     ` Zbigniew Jędrzejewski-Szmek
  2011-10-04 10:24       ` John Szakmeister
  0 siblings, 1 reply; 8+ messages in thread
From: Zbigniew Jędrzejewski-Szmek @ 2011-10-04  7:57 UTC (permalink / raw)
  To: robert mena; +Cc: Andreas Schwab, git

On 10/03/2011 10:57 PM, robert mena wrote:
> Thanks.
>
> It accepted the command but rejected my push.
>
> 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

Zbyszek

>
> On Mon, Oct 3, 2011 at 12:04 PM, Andreas Schwab<schwab@linux-m68k.org>  wrote:
>> robert mena<robert.mena@gmail.com>  writes:
>>
>>> I found the command filter but it is not working.
>>>
>>> git filter-branch --index-filter 'git rm --cached scripts/\\' HEAD
>>
>> $ git filter-branch --index-filter 'git rm -q --ignore-unmatch --cached scripts/\\' HEAD
>>
>> Andreas.
>>
>> --
>> Andreas Schwab, schwab@linux-m68k.org
>> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
>> "And now for something completely different."
>>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to remove a file
  2011-10-04  7:57     ` Zbigniew Jędrzejewski-Szmek
@ 2011-10-04 10:24       ` John Szakmeister
  2011-10-04 11:36         ` robert mena
  0 siblings, 1 reply; 8+ messages in thread
From: John Szakmeister @ 2011-10-04 10:24 UTC (permalink / raw)
  To: Zbigniew Jędrzejewski-Szmek; +Cc: robert mena, Andreas Schwab, git

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to remove a file
  2011-10-04 10:24       ` John Szakmeister
@ 2011-10-04 11:36         ` robert mena
  2011-10-04 14:08           ` Zbigniew Jędrzejewski-Szmek
  0 siblings, 1 reply; 8+ messages in thread
From: robert mena @ 2011-10-04 11:36 UTC (permalink / raw)
  To: John Szakmeister; +Cc: Zbigniew Jędrzejewski-Szmek, Andreas Schwab, git

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?

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
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to remove a file
  2011-10-04 11:36         ` robert mena
@ 2011-10-04 14:08           ` Zbigniew Jędrzejewski-Szmek
  2011-10-04 14:50             ` Andreas Schwab
  0 siblings, 1 reply; 8+ messages in thread
From: Zbigniew Jędrzejewski-Szmek @ 2011-10-04 14:08 UTC (permalink / raw)
  To: robert mena; +Cc: John Szakmeister, Andreas Schwab, git

On 10/04/2011 01:36 PM, robert mena wrote:
> 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


> 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
>>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Unable to remove a file
  2011-10-04 14:08           ` Zbigniew Jędrzejewski-Szmek
@ 2011-10-04 14:50             ` Andreas Schwab
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2011-10-04 14:50 UTC (permalink / raw)
  To: Zbigniew Jędrzejewski-Szmek; +Cc: robert mena, John Szakmeister, git

Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:

> git fetch updates the remote references, always.

Only if the refspec starts with '+'.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-10-04 14:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-03 14:21 Unable to remove a file robert mena
2011-10-03 16:04 ` Andreas Schwab
2011-10-03 20:57   ` robert mena
2011-10-04  7:57     ` Zbigniew Jędrzejewski-Szmek
2011-10-04 10:24       ` John Szakmeister
2011-10-04 11:36         ` robert mena
2011-10-04 14:08           ` Zbigniew Jędrzejewski-Szmek
2011-10-04 14:50             ` Andreas Schwab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.