# git p4 clone - HEAD + partial history

3 messages from 2015-05-12 to 2015-05-12. Participants: FusionX86, Luke Diamand.
Thread: https://gitlist.dev/t/39313

## FusionX86, 2015-05-12 19:31

Subject: git p4 clone - HEAD + partial history
Message-ID: <CAFcBi8_sARUkD2iDeto2CXr1vOm473aOSbj9dCiERTj51ot59A@mail.gmail.com>
URL: https://gitlist.dev/e/CAFcBi8_sARUkD2iDeto2CXr1vOm473aOSbj9dCiERTj51ot59A%40mail.gmail.com

```
Hello,

I'm migrating my company from Perforce to Git. There is history in
Perforce that goes back to 2006 and I'd like to migrate it with some,
but not all of the history. I'm not having luck so far.

>From what I see, a simple git p4 clone grabs HEAD only. Using @all
grabs all history and is way too much to migrate. I have tried using
//depot/folder@2015/01/01,@all when cloning, but it doesn't grab the
current stuff in HEAD.

Is it possible to grab what is currently in HEAD and the last few
months of history only?

```

## Luke Diamand, 2015-05-12 19:55

Subject: Re: git p4 clone - HEAD + partial history
Message-ID: <55525A99.9070702@diamand.org>
URL: https://gitlist.dev/e/55525A99.9070702%40diamand.org
In-Reply-To: <CAFcBi8_sARUkD2iDeto2CXr1vOm473aOSbj9dCiERTj51ot59A@mail.gmail.com>

```
On 12/05/15 20:31, FusionX86 wrote:
> Hello,
>
> I'm migrating my company from Perforce to Git. There is history in
> Perforce that goes back to 2006 and I'd like to migrate it with some,
> but not all of the history. I'm not having luck so far.
>
>  From what I see, a simple git p4 clone grabs HEAD only. Using @all
> grabs all history and is way too much to migrate. I have tried using
> //depot/folder@2015/01/01,@all when cloning, but it doesn't grab the
> current stuff in HEAD.
>
> Is it possible to grab what is currently in HEAD and the last few
> months of history only?

What I've done in the past is just find a commit that's about the right 
date, and clone from there.

i.e.

$ git p4 clone //depot/folder/...@12345
$ git p4 sync

The usual problem I have after that is that P4 repos can get very large, 
and the process can quite time consuming....

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

```

## FusionX86, 2015-05-12 20:23

Subject: Re: git p4 clone - HEAD + partial history
Message-ID: <CAFcBi89+FuvB=VF3nCDy7_xrwz=Of_omkCn35MdXBwhy6VckjQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAFcBi89%2BFuvB%3DVF3nCDy7_xrwz%3DOf_omkCn35MdXBwhy6VckjQ%40mail.gmail.com
In-Reply-To: <55525A99.9070702@diamand.org>

```
Thanks Luke! I'll give that a shot.

On Tue, May 12, 2015 at 1:55 PM, Luke Diamand <luke@diamand.org> wrote:
> On 12/05/15 20:31, FusionX86 wrote:
>>
>> Hello,
>>
>> I'm migrating my company from Perforce to Git. There is history in
>> Perforce that goes back to 2006 and I'd like to migrate it with some,
>> but not all of the history. I'm not having luck so far.
>>
>>  From what I see, a simple git p4 clone grabs HEAD only. Using @all
>> grabs all history and is way too much to migrate. I have tried using
>> //depot/folder@2015/01/01,@all when cloning, but it doesn't grab the
>> current stuff in HEAD.
>>
>> Is it possible to grab what is currently in HEAD and the last few
>> months of history only?
>
>
> What I've done in the past is just find a commit that's about the right
> date, and clone from there.
>
> i.e.
>
> $ git p4 clone //depot/folder/...@12345
> $ git p4 sync
>
> The usual problem I have after that is that P4 repos can get very large, and
> the process can quite time consuming....
>
>> --
>> 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
>>
>

```
