{"thread":{"id":"22358","subject":"Advice for \"pseudo public\" repository on a USB key for a single contributer project","startedAt":"2010-01-23T18:27:04Z","lastAt":"2010-01-24T10:21:51Z","messageCount":3,"participants":["Maxime Lévesque","Tay Ray Chuan","Wincent Colaiuta"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"132491","messageId":"554f5f781001231027vd322045hf84e2a16208bcc9f@mail.gmail.com","threadId":"22358","inReplyTo":null,"subject":"Advice for \"pseudo public\" repository on a USB key for a single contributer project","fromName":"Maxime Lévesque","fromEmail":"maxime.levesque@gmail.com","sentAt":"2010-01-23T18:27:04Z","receivedAt":"2010-01-23T18:27:04Z","isPatch":false,"sender":{"key":"maxime.levesque@gmail.com","avatar":null},"body":"   Hello Gitsers,\n\n  I'm a Git newbee, and I have started a project, with a few month's of code\n in\n a local git repository.\n\n I am the only develloper/contributor to this repo. I have a clone of my\n repository\n on a USB key, for back up purposes. Once in a while I work on another\n machine\n where I have cloned a repo from the USB key.\n\n Since there are no servers involved, I have used pull command\n to move my 'HEAD' around :\n\n after working on machine1 I do :\n\n   commit to machine1Repo\n   machine1Repo  --pull--> USBKeyRepo\n\n\n when I switch on machine2 I start by bringing it up to date from the key :\n\n\n   machine2Repo  <--pull-- USBKeyRepo\n\n  and when I'm finished  :\n\n  commit to machine2Repo\n  machine1Repo  --pull--> USBKeyRepo\n\n  So far I have done all of this using the master branch,\n and things don'g always go smoothly I sometimes have\n conflicts that don't seem logical, since I'm the only\n contrbutor, I should never need to do merges.\n\n  From what I have read my USBKey repo is like a public repo,\n so I have tried using a bare repo, because since I never work\n directly on the usb key, the souces on this repo are just\n adding unnecessary complexity. So far I had no success,\n because the pull command doesn't recognize my bare repo,\n it seems that bare repos must me accessed via a daemon process.\n\n  I suspect that I'm probably not using Git correctly (or optimally),\n which is why I am inquiring here.\n\n Should I be using a dedicated branch\n on each machine (as if I were two contributors) ?\n Is it wise to use pulls instead of pushes ?\n Should I be using a bare repo on my key ?\n\n\n  Any insight would be appreciated.\n\n Thank you all\n"},{"id":"132523","messageId":"be6fef0d1001231817s265dac68v646d71b688e0ed1e@mail.gmail.com","threadId":"22358","inReplyTo":"554f5f781001231027vd322045hf84e2a16208bcc9f@mail.gmail.com","subject":"Re: Advice for \"pseudo public\" repository on a USB key for a single contributer project","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-01-24T02:17:34Z","receivedAt":"2010-01-24T02:17:34Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\n2010/1/24 Maxime Lévesque <maxime.levesque@gmail.com>:\n>  Since there are no servers involved, I have used pull command\n>  to move my 'HEAD' around :\n>\n>  after working on machine1 I do :\n>\n>    commit to machine1Repo\n>    machine1Repo  --pull--> USBKeyRepo\n\nI think you mean \"push\", since what you want is to make the changes in\nmachine1Repo available in USBKeyRepo.\n\n>  when I switch on machine2 I start by bringing it up to date from the key :\n>\n>\n>    machine2Repo  <--pull-- USBKeyRepo\n>\n>   and when I'm finished  :\n>\n>   commit to machine2Repo\n>   machine1Repo  --pull--> USBKeyRepo\n\nI think you mean \"push\" here and s/machine1/machine2/ too, so that would read\n\n  machine2Repo --push--> USBKeyRepo\n\nWhen you make changes on machine2 and go back to machine1, you need to\nfetch/pull in your changes, just like you do for machine2Repo:\n\n  machine1Repo  <--pull-- USBKeyRepo\n\n>   From what I have read my USBKey repo is like a public repo,\n>  so I have tried using a bare repo, because since I never work\n>  directly on the usb key, the souces on this repo are just\n>  adding unnecessary complexity. So far I had no success,\n>  because the pull command doesn't recognize my bare repo,\n>  it seems that bare repos must me accessed via a daemon process.\n\nWhat's your config?\n\nAssuming you use master everywhere, I think you could use this in your config:\n\n  [remote \"USBKeyRepo\"]\n    url = /path/to/repo\n    fetch = master\n  [branch \"master\"]\n    remote = USBKeyRepo\n    merge = master\n\n>  Is it wise to use pulls instead of pushes ?\n\nSee above. You can't use one \"instead of\" another - they serve\ndifferent purposes and don't replace one another.\n\n>  Should I be using a bare repo on my key ?\n\nDefinitely, or else you would have a working tree in that repo too but\nit never gets updated - not to mention all the warnings git would\nshow.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"132530","messageId":"3CFFC525-266B-4E98-9A99-83316B22978C@wincent.com","threadId":"22358","inReplyTo":"be6fef0d1001231817s265dac68v646d71b688e0ed1e@mail.gmail.com","subject":"Re: Advice for \"pseudo public\" repository on a USB key for a single contributer project","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2010-01-24T10:21:51Z","receivedAt":"2010-01-24T10:21:51Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 24/01/2010, a las 03:17, Tay Ray Chuan escribió:\n\n> Hi,\n>\n> 2010/1/24 Maxime Lévesque <maxime.levesque@gmail.com>:\n>>  Since there are no servers involved, I have used pull command\n>>  to move my 'HEAD' around :\n>>\n>>  after working on machine1 I do :\n>>\n>>    commit to machine1Repo\n>>    machine1Repo  --pull--> USBKeyRepo\n>\n> I think you mean \"push\", since what you want is to make the changes in\n> machine1Repo available in USBKeyRepo.\n>\n>>  when I switch on machine2 I start by bringing it up to date from  \n>> the key :\n>>\n>>\n>>    machine2Repo  <--pull-- USBKeyRepo\n>>\n>>   and when I'm finished  :\n>>\n>>   commit to machine2Repo\n>>   machine1Repo  --pull--> USBKeyRepo\n>\n> I think you mean \"push\" here and s/machine1/machine2/ too, so that  \n> would read\n>\n>  machine2Repo --push--> USBKeyRepo\n>\n> When you make changes on machine2 and go back to machine1, you need to\n> fetch/pull in your changes, just like you do for machine2Repo:\n>\n>  machine1Repo  <--pull-- USBKeyRepo\n>\n>>   From what I have read my USBKey repo is like a public repo,\n>>  so I have tried using a bare repo, because since I never work\n>>  directly on the usb key, the souces on this repo are just\n>>  adding unnecessary complexity. So far I had no success,\n>>  because the pull command doesn't recognize my bare repo,\n>>  it seems that bare repos must me accessed via a daemon process.\n\nFor this kind of workflow I generally use pull in both directions.  \nPush works only if it results in fast-forward merges in both  \ndirections, and if you are a little forgetful like me it's fairly easy  \nto sooner or later forget to update one of the repos and end up making  \ncommits in both of them, leading to a situation in which at least one  \nof the merges would have to be a non-fast-forward.\n\nIf you always pull, you are at least working in a non-bare repo at  \nthat point and you can choose to either (non-fast-forward) merge or  \nrebase.\n\nUnless you are really disciplined about synchronizing the repos before  \nyou ever start any work, then I think \"pull\" in both directions is the  \nway to go.\n\nCheers,\nWincent\n"}]}