threads / discuss / 18473

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

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

## tl;dr

8 messages between Mar 22, 2009 and Mar 22, 2009.

replies: 7people: 4as markdown or json

Anthony Rasmussen· Mar 22, 2009, 22:08 UTC · lore
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· Mar 22, 2009, 23:00 UTC · re: Anthony Rasmussen · lore

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

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· Mar 22, 2009, 23:06 UTC · re: Sverre Rabbelier · lore

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

On Sun, Mar 22, 2009 at 4:00 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:
Show 6 quoted lines
> 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· Mar 22, 2009, 23:10 UTC · re: Sverre Rabbelier · lore

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

On Mon, Mar 23, 2009 at 12:00:59AM +0100, Sverre Rabbelier wrote:
Show 5 quoted lines
> 
> 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· Mar 22, 2009, 23:10 UTC · re: Nicolas Sebrecht · lore

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

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· Mar 22, 2009, 23:16 UTC · re: Sverre Rabbelier · lore

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

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· Mar 22, 2009, 23:31 UTC · re: Sverre Rabbelier · lore

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

On Mon, Mar 23, 2009 at 12:10:48AM +0100, Sverre Rabbelier wrote:
Show 8 quoted lines
> 
> 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· Mar 22, 2009, 23:36 UTC · re: Nicolas Sebrecht · lore

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

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

← back to recent threads