All of lore.kernel.org
 help / color / mirror / Atom feed
* Help with repo management.
@ 2012-04-19 14:35 Mark Haney
  2012-04-19 23:49 ` Andrew Ardill
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Haney @ 2012-04-19 14:35 UTC (permalink / raw)
  To: git

I'm new to git and repo management and I have an issue that I can't 
quite figure out.  Here's my problem.

I have a server (SERVER) with a repo on it.  It has all my code and 
documentation.  I pulled that repo onto my workstation for a local copy 
so I could work at home or wherever with needing server access. My 
problem is I can /pull/ from the repo on SERVER, but I can't /push/ any 
local changes back to the server.  I get an error message about master 
being checked out.

I know a little about bare repos, but my understanding is that the bare 
repo doesn't actually have the actual files in it, just the changes, 
which is not what I want.  I would like to have the copy on SERVER to 
work from if I want, and also be able to pull/push changes from my local 
copy as well.  That way I have 2 copies of the data handy (not to 
mention the disc backups.

I'm fairly sure this can be setup, but I just don't know enough to 
figure it out.  Can someone point me in the right direction?

-- 

Mark Haney
Software Developer/Consultant
AB Emblem
markh@abemblem.com
Linux marius.homelinux 3.3.1-5.fc16.x86_64 GNU/Linux

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Help with repo management.
  2012-04-19 14:35 Help with repo management Mark Haney
@ 2012-04-19 23:49 ` Andrew Ardill
  2012-04-20 12:39   ` Mark Haney
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Ardill @ 2012-04-19 23:49 UTC (permalink / raw)
  To: Mark Haney; +Cc: git

On 20 April 2012 00:35, Mark Haney <markh@abemblem.com> wrote:
> I'm new to git and repo management and I have an issue that I can't quite
> figure out.  Here's my problem.
>
> I have a server (SERVER) with a repo on it.  It has all my code and
> documentation.  I pulled that repo onto my workstation for a local copy so I
> could work at home or wherever with needing server access. My problem is I
> can /pull/ from the repo on SERVER, but I can't /push/ any local changes
> back to the server.  I get an error message about master being checked out.
>
> I know a little about bare repos, but my understanding is that the bare repo
> doesn't actually have the actual files in it, just the changes, which is not
> what I want.  I would like to have the copy on SERVER to work from if I
> want, and also be able to pull/push changes from my local copy as well.
>  That way I have 2 copies of the data handy (not to mention the disc
> backups.
>
> I'm fairly sure this can be setup, but I just don't know enough to figure it
> out.  Can someone point me in the right direction?
>

First things first, don't think that just because a bare repository
does not have a working copy that it doesn't have all the data. Having
a local working copy and a bare repository on a server _is_ keeping
two separate copies of your data handy, just one is not immediately
accessible (you have to check it out first). This may be your
understanding, but it was unclear so I thought I would clarify.

In terms of pushing to a remote, it is best practice to NOT push to a
repository that has a checked out working copy. The main reason for
this is that it becomes much easier to lose data, which is bad.

Instead, if you want to work on SERVER as well as some other machine,
it is safer to checkout the bare repository to another repository on
SERVER, pulling and pushing to the bare repository in the same fashion
as you would from a remote machine.

Some more explanation can be found at
http://gitready.com/advanced/2009/02/01/push-to-only-bare-repositories.html
for example.

Regards,

Andrew Ardill

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Help with repo management.
  2012-04-19 23:49 ` Andrew Ardill
@ 2012-04-20 12:39   ` Mark Haney
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Haney @ 2012-04-20 12:39 UTC (permalink / raw)
  To: git

On 04/19/2012 07:49 PM, Andrew Ardill wrote:

>
> First things first, don't think that just because a bare repository
> does not have a working copy that it doesn't have all the data. Having
> a local working copy and a bare repository on a server _is_ keeping
> two separate copies of your data handy, just one is not immediately
> accessible (you have to check it out first). This may be your
> understanding, but it was unclear so I thought I would clarify.
>
> In terms of pushing to a remote, it is best practice to NOT push to a
> repository that has a checked out working copy. The main reason for
> this is that it becomes much easier to lose data, which is bad.
>
> Instead, if you want to work on SERVER as well as some other machine,
> it is safer to checkout the bare repository to another repository on
> SERVER, pulling and pushing to the bare repository in the same fashion
> as you would from a remote machine.
>
> Some more explanation can be found at
> http://gitready.com/advanced/2009/02/01/push-to-only-bare-repositories.html
> for example.
>


Well, that's originally what I thought, that the bare repository carries 
all the data.  But (and I'm not sure how this came about), the more I 
was reading on using git the more it read like the bare repository ONLY 
housed the changes made.  For example, I have a technical document on 
how the structure of the database I'm designing.  If I edit the document 
and then push it to the bare repo, the ONLY thing in the bare repo is 
the delta of that document, not the delta AND the original document. 
Does that make sense?

In essence, it sounded to me like the bare repo required a copy of the 
original data in order for it to be used, since it only housed the 
deltas of the original, not the originals themselves.

In retrospect, it sounds a bit silly now, I suppose since it would be 
impossible to for someone new to pull a copy of the data down from the 
bare repo and have it be useful.  But, that's how I read the docs I had 
googled when first getting started with this project.

I hope that makes it a little easier to understand why I had the problem 
I was having.  Thanks a lot for the informative reply, and the patience 
to do so.


-- 

Mark Haney
Software Developer/Consultant
AB Emblem
markh@abemblem.com
Linux marius.homelinux 3.3.1-5.fc16.x86_64 GNU/Linux

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-20 13:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19 14:35 Help with repo management Mark Haney
2012-04-19 23:49 ` Andrew Ardill
2012-04-20 12:39   ` Mark Haney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.