{"thread":{"id":"30286","subject":"Help with repo management.","startedAt":"2012-04-19T14:35:00Z","lastAt":"2012-04-20T12:39:47Z","messageCount":3,"participants":["Mark Haney","Andrew Ardill"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"189707","messageId":"4F902294.10302@abemblem.com","threadId":"30286","inReplyTo":null,"subject":"Help with repo management.","fromName":"Mark Haney","fromEmail":"markh@abemblem.com","sentAt":"2012-04-19T14:35:00Z","receivedAt":"2012-04-19T14:35:00Z","isPatch":false,"sender":{"key":"markh@abemblem.com","avatar":null},"body":"I'm new to git and repo management and I have an issue that I can't \nquite figure out.  Here's my problem.\n\nI have a server (SERVER) with a repo on it.  It has all my code and \ndocumentation.  I pulled that repo onto my workstation for a local copy \nso I could work at home or wherever with needing server access. My \nproblem is I can /pull/ from the repo on SERVER, but I can't /push/ any \nlocal changes back to the server.  I get an error message about master \nbeing checked out.\n\nI know a little about bare repos, but my understanding is that the bare \nrepo doesn't actually have the actual files in it, just the changes, \nwhich is not what I want.  I would like to have the copy on SERVER to \nwork from if I want, and also be able to pull/push changes from my local \ncopy as well.  That way I have 2 copies of the data handy (not to \nmention the disc backups.\n\nI'm fairly sure this can be setup, but I just don't know enough to \nfigure it out.  Can someone point me in the right direction?\n\n-- \n\nMark Haney\nSoftware Developer/Consultant\nAB Emblem\nmarkh@abemblem.com\nLinux marius.homelinux 3.3.1-5.fc16.x86_64 GNU/Linux\n"},{"id":"189737","messageId":"CAH5451nL+BiZPo-cWHwYC4GkA=pT3zgBXi_M-TB-qgDfmy7yow@mail.gmail.com","threadId":"30286","inReplyTo":"4F902294.10302@abemblem.com","subject":"Re: Help with repo management.","fromName":"Andrew Ardill","fromEmail":"andrew.ardill@gmail.com","sentAt":"2012-04-19T23:49:39Z","receivedAt":"2012-04-19T23:49:39Z","isPatch":false,"sender":{"key":"andrew.ardill@gmail.com","avatar":"https://gravatar.com/avatar/da14cb7c091dd44dc6c63a4d3361b149acaf25226dc78eb4131a17b93d9b0993?d=mp&s=160"},"body":"On 20 April 2012 00:35, Mark Haney <markh@abemblem.com> wrote:\n> I'm new to git and repo management and I have an issue that I can't quite\n> figure out.  Here's my problem.\n>\n> I have a server (SERVER) with a repo on it.  It has all my code and\n> documentation.  I pulled that repo onto my workstation for a local copy so I\n> could work at home or wherever with needing server access. My problem is I\n> can /pull/ from the repo on SERVER, but I can't /push/ any local changes\n> back to the server.  I get an error message about master being checked out.\n>\n> I know a little about bare repos, but my understanding is that the bare repo\n> doesn't actually have the actual files in it, just the changes, which is not\n> what I want.  I would like to have the copy on SERVER to work from if I\n> want, and also be able to pull/push changes from my local copy as well.\n>  That way I have 2 copies of the data handy (not to mention the disc\n> backups.\n>\n> I'm fairly sure this can be setup, but I just don't know enough to figure it\n> out.  Can someone point me in the right direction?\n>\n\nFirst things first, don't think that just because a bare repository\ndoes not have a working copy that it doesn't have all the data. Having\na local working copy and a bare repository on a server _is_ keeping\ntwo separate copies of your data handy, just one is not immediately\naccessible (you have to check it out first). This may be your\nunderstanding, but it was unclear so I thought I would clarify.\n\nIn terms of pushing to a remote, it is best practice to NOT push to a\nrepository that has a checked out working copy. The main reason for\nthis is that it becomes much easier to lose data, which is bad.\n\nInstead, if you want to work on SERVER as well as some other machine,\nit is safer to checkout the bare repository to another repository on\nSERVER, pulling and pushing to the bare repository in the same fashion\nas you would from a remote machine.\n\nSome more explanation can be found at\nhttp://gitready.com/advanced/2009/02/01/push-to-only-bare-repositories.html\nfor example.\n\nRegards,\n\nAndrew Ardill\n"},{"id":"189747","messageId":"4F915913.10908@abemblem.com","threadId":"30286","inReplyTo":"CAH5451nL+BiZPo-cWHwYC4GkA=pT3zgBXi_M-TB-qgDfmy7yow@mail.gmail.com","subject":"Re: Help with repo management.","fromName":"Mark Haney","fromEmail":"markh@abemblem.com","sentAt":"2012-04-20T12:39:47Z","receivedAt":"2012-04-20T12:39:47Z","isPatch":false,"sender":{"key":"markh@abemblem.com","avatar":null},"body":"On 04/19/2012 07:49 PM, Andrew Ardill wrote:\n\n>\n> First things first, don't think that just because a bare repository\n> does not have a working copy that it doesn't have all the data. Having\n> a local working copy and a bare repository on a server _is_ keeping\n> two separate copies of your data handy, just one is not immediately\n> accessible (you have to check it out first). This may be your\n> understanding, but it was unclear so I thought I would clarify.\n>\n> In terms of pushing to a remote, it is best practice to NOT push to a\n> repository that has a checked out working copy. The main reason for\n> this is that it becomes much easier to lose data, which is bad.\n>\n> Instead, if you want to work on SERVER as well as some other machine,\n> it is safer to checkout the bare repository to another repository on\n> SERVER, pulling and pushing to the bare repository in the same fashion\n> as you would from a remote machine.\n>\n> Some more explanation can be found at\n> http://gitready.com/advanced/2009/02/01/push-to-only-bare-repositories.html\n> for example.\n>\n\n\nWell, that's originally what I thought, that the bare repository carries \nall the data.  But (and I'm not sure how this came about), the more I \nwas reading on using git the more it read like the bare repository ONLY \nhoused the changes made.  For example, I have a technical document on \nhow the structure of the database I'm designing.  If I edit the document \nand then push it to the bare repo, the ONLY thing in the bare repo is \nthe delta of that document, not the delta AND the original document. \nDoes that make sense?\n\nIn essence, it sounded to me like the bare repo required a copy of the \noriginal data in order for it to be used, since it only housed the \ndeltas of the original, not the originals themselves.\n\nIn retrospect, it sounds a bit silly now, I suppose since it would be \nimpossible to for someone new to pull a copy of the data down from the \nbare repo and have it be useful.  But, that's how I read the docs I had \ngoogled when first getting started with this project.\n\nI hope that makes it a little easier to understand why I had the problem \nI was having.  Thanks a lot for the informative reply, and the patience \nto do so.\n\n\n-- \n\nMark Haney\nSoftware Developer/Consultant\nAB Emblem\nmarkh@abemblem.com\nLinux marius.homelinux 3.3.1-5.fc16.x86_64 GNU/Linux\n"}]}