# Newbie: Do I need to download the entire repo to work on just 1 file?

8 messages from 2009-03-22 to 2009-03-22. Participants: Anthony Rasmussen, Sverre Rabbelier, Geoffrey Lee, Nicolas Sebrecht.
Thread: https://gitlist.dev/t/18473

## Anthony Rasmussen, 2009-03-22 22:08

Subject: Newbie: Do I need to download the entire repo to work on just 1 file?
Message-ID: <BLU121-W15DB0E5CEBC1DA697E5ED8B4950@phx.gbl>
URL: https://gitlist.dev/e/BLU121-W15DB0E5CEBC1DA697E5ED8B4950%40phx.gbl

```


Hi all,

The large website has a developers-only version of the site published on a server, which is tracked by git.

I
only have to work on 1 file.  I'd like to work on it, test changes on
the dev site, work on it some more, then commit when ready.

Do I have to download the entire rep onto my laptop in order to do this?  I have read and read, but I am quite confused :)

Thanks for your help!

_________________________________________________________________
Get quick access to your favorite MSN content with Internet Explorer 8. 
http://ie8.msn.com/microsoft/internet-explorer-8/en-us/ie8.aspx?ocid=B037MSN55C0701A
```

## Sverre Rabbelier, 2009-03-22 23:00

Subject: Re: Newbie: Do I need to download the entire repo to work on just 1 file?
Message-ID: <fabb9a1e0903221600j22cf028fl903aef8076e53777@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e0903221600j22cf028fl903aef8076e53777%40mail.gmail.com
In-Reply-To: <BLU121-W15DB0E5CEBC1DA697E5ED8B4950@phx.gbl>

```
Heya,

On Sun, Mar 22, 2009 at 23:08, Anthony Rasmussen <evoluenta@hotmail.com> wrote:
> Do I have to download the entire rep onto my laptop in order to do this?  I have read and read, but I am quite confused :)

Yes, you do, in general though, git repositories are quite compact
compared to, say, a svn checkouts. It is not unheard of that the full
git clone is smaller than the same code as svn checkout.

-- 
Cheers,

Sverre Rabbelier

```

## Geoffrey Lee, 2009-03-22 23:06

Subject: Re: Newbie: Do I need to download the entire repo to work on just 1 file?
Message-ID: <83d7aaa40903221606yd84412cna873554f7f58a75f@mail.gmail.com>
URL: https://gitlist.dev/e/83d7aaa40903221606yd84412cna873554f7f58a75f%40mail.gmail.com
In-Reply-To: <fabb9a1e0903221600j22cf028fl903aef8076e53777@mail.gmail.com>

```
On Sun, Mar 22, 2009 at 4:00 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:
> On Sun, Mar 22, 2009 at 23:08, Anthony Rasmussen <evoluenta@hotmail.com> wrote:
>> Do I have to download the entire rep onto my laptop in order to do this?  I have read and read, but I am quite confused :)
>
> Yes, you do, in general though, git repositories are quite compact
> compared to, say, a svn checkouts. It is not unheard of that the full
> git clone is smaller than the same code as svn checkout.

It depends on what you mean by "entire repo". Of course you need all
the source files to compile, but you do not need past revisions. Take
a look at the --depth parameter for git-clone.

-Geoffrey Lee

```

## Nicolas Sebrecht, 2009-03-22 23:10

Subject: Re: Newbie: Do I need to download the entire repo to work on just 1 file?
Message-ID: <20090322231002.GA12974@vidovic>
URL: https://gitlist.dev/e/20090322231002.GA12974%40vidovic
In-Reply-To: <fabb9a1e0903221600j22cf028fl903aef8076e53777@mail.gmail.com>

```

On Mon, Mar 23, 2009 at 12:00:59AM +0100, Sverre Rabbelier wrote:
> 
> Heya,
> 
> On Sun, Mar 22, 2009 at 23:08, Anthony Rasmussen <evoluenta@hotmail.com> wrote:
> > Do I have to download the entire rep onto my laptop in order to do this?  I have read and read, but I am quite confused :)

Please, wrap your lines to something convenient (72-80 characters max).

> Yes, you do

No, you don't. Why not use the '--depth <depth>' option of 'git clone' ?

-- 
Nicolas Sebrecht

```

## Sverre Rabbelier, 2009-03-22 23:10

Subject: Re: Newbie: Do I need to download the entire repo to work on just 1 file?
Message-ID: <fabb9a1e0903221610p3b11f09ctc6a9f4d38b1bda3e@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e0903221610p3b11f09ctc6a9f4d38b1bda3e%40mail.gmail.com
In-Reply-To: <20090322231002.GA12974@vidovic>

```
Heya,

On Mon, Mar 23, 2009 at 00:10, Nicolas Sebrecht
<nicolas.s-dev@laposte.net> wrote:
> No, you don't. Why not use the '--depth <depth>' option of 'git clone' ?

That depends on if he wants to push back to the original repo or not, right?

-- 
Cheers,

Sverre Rabbelier

```

## Geoffrey Lee, 2009-03-22 23:16

Subject: Re: Newbie: Do I need to download the entire repo to work on just 1 file?
Message-ID: <83d7aaa40903221616x706fe579r9c8d3d792d2341e0@mail.gmail.com>
URL: https://gitlist.dev/e/83d7aaa40903221616x706fe579r9c8d3d792d2341e0%40mail.gmail.com
In-Reply-To: <fabb9a1e0903221610p3b11f09ctc6a9f4d38b1bda3e@mail.gmail.com>

```
On Sun, Mar 22, 2009 at 4:10 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:
> That depends on if he wants to push back to the original repo or not, right?

Correct. You cannot push, fetch, or clone a shallow repo. And for Git
development, it's all about sending patches, so you don't need past
revisions.

-Geoffrey Lee

```

## Nicolas Sebrecht, 2009-03-22 23:31

Subject: Re: Newbie: Do I need to download the entire repo to work on just 1 file?
Message-ID: <20090322233120.GC12974@vidovic>
URL: https://gitlist.dev/e/20090322233120.GC12974%40vidovic
In-Reply-To: <fabb9a1e0903221610p3b11f09ctc6a9f4d38b1bda3e@mail.gmail.com>

```

On Mon, Mar 23, 2009 at 12:10:48AM +0100, Sverre Rabbelier wrote:
> 
> Heya,
> 
> On Mon, Mar 23, 2009 at 00:10, Nicolas Sebrecht
> <nicolas.s-dev@laposte.net> wrote:
> > No, you don't. Why not use the '--depth <depth>' option of 'git clone' ?
> 
> That depends on if he wants to push back to the original repo or not, right?

It depends of what the OP means by "entire repository". You can't
"cherry-pick" one single file without download the entire tree of the
working directory.

You can push with a truncated history. What you can't do is checkout
from the history you don't have in your local repository.

-- 
Nicolas Sebrecht

```

## Nicolas Sebrecht, 2009-03-22 23:36

Subject: Re: Newbie: Do I need to download the entire repo to work on just 1 file?
Message-ID: <20090322233608.GD12974@vidovic>
URL: https://gitlist.dev/e/20090322233608.GD12974%40vidovic
In-Reply-To: <20090322233120.GC12974@vidovic>

```

On Mon, Mar 23, 2009 at 12:31:20AM +0100, Nicolas Sebrecht wrote:

> You can push with a truncated history. What you can't do is checkout
> from the history you don't have in your local repository.

I just told my biggest mistake today. It's time to go to the bed.

-- 
Nicolas Sebrecht

```
