Re: git to p4 conversion

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

 



On Fri, Feb 4, 2011 at 11:49 AM, Endre Czirbesz <endre@xxxxxxxxxxx> wrote:
> Hi All,
>
> Thanks for the replies.
>
> 2011/2/4 Tor Arvid Lund <torarvid@xxxxxxxxx>:
>> On Fri, Feb 4, 2011 at 1:03 AM, Vitor Antunes <vitor.hda@xxxxxxxxx> wrote:
>>> git remote add remotename myprojectrepo
>
>> Endre, you should start like you already have; by git-p4 cloning your
>> project from perforce. (You maybe want to have a dummy file checked in
>> to your <projectdir> in perforce, so that the 'git-p4 clone' command
>> produces at least one commit in your git repo)...
>>
>> Then, do 'git remote add tempremote <path-to-your-existing-git-repo>'
>> like Vitor suggests.
>>
>> At this point I would do:
>>
>> $ git checkout -b tempbranch tempremote/master
> At this point I got an error message:
> fatal: git checkout: updating paths is incompatible with switching branches.
>
> So I fetched my tempremote first:
> $ git fetch tempremote
> $ git checkout -b tempbranch tempremote/master

See, this is what happens when I write a "how-to" and not actually try
it out before sending it... Obviously, you are correct in that you
have to fetch it before being able to check it out :-)

> (I got a warning from fetch, that there are no common commits, but I
> supposed that it is right. :) )

That is correct.

>> $ git rebase master
> It applied all my commits.
>
>> $ git-p4 submit
> ÂSynchronizing p4 checkout...
> Â... - file(s) up-to-date.
> ÂApplying 1##############################9 Initial commit
> Âerror: ***: already exists in working directory
> [...]
> ÂUnfortunately applying the change failed!
>
> It said this error for all my files. :(
> But I think we are almost there. :)

Again, if only I'd tried it myself first! ;)

Well, I can get it to work if I do:
$ git p4 sync

before the 'git p4 submit'.

Try that, and see if it works for you. (BTW, when committing
half-works, and then fails, oftentimes you need to do a bit of cleanup
in perforce... Revert files, manually remove files created by git
inside your p4 clientspec root directory, that sort of thing...)

    -- Tor Arvid
--
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]