Re: Unable to remove a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>:
2011/10/4 Zbigniew Jędrzejewski-Szmek<zbyszek@xxxxxxxxx>:
[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



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]