{"thread":{"id":"17274","subject":"Newbie Query","startedAt":"2009-01-20T19:19:52Z","lastAt":"2009-01-21T14:31:13Z","messageCount":11,"participants":["Chris Willard","Sverre Rabbelier","Reece Dunn","Tomas Carnecky","Nicolas Morey-Chaisemartin","Boyd Stephen Smith Jr.","Jeff King","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"101289","messageId":"20090120191952.GA25322@uts.thewillards.local","threadId":"17274","inReplyTo":null,"subject":"Newbie Query","fromName":"Chris Willard","fromEmail":"chris@thewillards.co.uk","sentAt":"2009-01-20T19:19:52Z","receivedAt":"2009-01-20T19:19:52Z","isPatch":false,"sender":{"key":"chris@thewillards.co.uk","avatar":null},"body":"Hello All,\n\nI am having a go at using git and need a bit of help.\n\nI have git installed on my laptop and on my pc. I created some files\non the pc then used git close via ssh to put them on my laptop - all\nOK so far!\n\nI then modified the files, added them, commited the changes and then\nused git push to put them on the PC - still no problems.\n\nBoth systems show the commits but the PC does not have the latest\nversion of the files. Git status on the PC shows the file as changed\nbut commiting give an error when pushing from the laptop. \n\nI assume that I need to run a command on the PC to get both systems\nthe same. Is it a reset or something else? \n\n\nRegards,\n\n\n\nChris\n\n-- \n... \"Even the gods did not spring into being overnight.\" Spock\n\n--\nThis message was scanned by ESVA and is believed to be clean.\n"},{"id":"101298","messageId":"49762D5F.2050702@dbservice.com","threadId":"17274","inReplyTo":"20090120191952.GA25322@uts.thewillards.local","subject":"Re: Newbie Query","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2009-01-20T20:00:31Z","receivedAt":"2009-01-20T20:00:31Z","isPatch":false,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"On 01/20/2009 08:19 PM, Chris Willard wrote:\n> Hello All,\n>\n> I am having a go at using git and need a bit of help.\n>\n> I have git installed on my laptop and on my pc. I created some files\n> on the pc then used git close via ssh to put them on my laptop - all\n> OK so far!\n>\n> I then modified the files, added them, commited the changes and then\n> used git push to put them on the PC - still no problems.\n>\n> Both systems show the commits but the PC does not have the latest\n> version of the files. Git status on the PC shows the file as changed\n> but commiting give an error when pushing from the laptop.\n>\n> I assume that I need to run a command on the PC to get both systems\n> the same. Is it a reset or something else?\n\nhttp://git.or.cz/gitwiki/GitFaq#non-bare\n\ntom\n"},{"id":"101294","messageId":"bd6139dc0901201216k45ec4da9k73ad37a22a8062a4@mail.gmail.com","threadId":"17274","inReplyTo":"20090120191952.GA25322@uts.thewillards.local","subject":"Re: Newbie Query","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-01-20T20:16:11Z","receivedAt":"2009-01-20T20:16:11Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Tue, Jan 20, 2009 at 20:19, Chris Willard <chris@thewillards.co.uk> wrote:\n> I then modified the files, added them, commited the changes and then\n> used git push to put them on the PC - still no problems.\n>\n> Both systems show the commits but the PC does not have the latest\n> version of the files. Git status on the PC shows the file as changed\n> but commiting give an error when pushing from the laptop.\n\nPlease read http://git.or.cz/gitwiki/GitFaq#head-b96f48bc9c925074be9f95c0fce69bcece5f6e73\nand let us know if you have any other problems.\n\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"101295","messageId":"3f4fd2640901201217x22262655w115cc2a25e32865e@mail.gmail.com","threadId":"17274","inReplyTo":"20090120191952.GA25322@uts.thewillards.local","subject":"Re: Newbie Query","fromName":"Reece Dunn","fromEmail":"msclrhd@googlemail.com","sentAt":"2009-01-20T20:17:11Z","receivedAt":"2009-01-20T20:17:11Z","isPatch":false,"sender":{"key":"msclrhd@googlemail.com","avatar":null},"body":"2009/1/20 Chris Willard <chris@thewillards.co.uk>:\n> Hello All,\n>\n> I then modified the files, added them, commited the changes and then\n> used git push to put them on the PC - still no problems.\n>\n> Both systems show the commits but the PC does not have the latest\n> version of the files. Git status on the PC shows the file as changed\n> but commiting give an error when pushing from the laptop.\n>\n> I assume that I need to run a command on the PC to get both systems\n> the same. Is it a reset or something else?\n\nSo IIUC running 'git log' on the machine you pushed the changes to,\nyou can see the checkin you made on the machine you made the change\non? You need to run 'git checkout' on the machine you pushed to, to\ntell git that you want these files. This is a safety feature, since\nsomeone may be working on the files on that machine locally, and so\ndoesn't want them being overwritten by your push.\n\nYou may find the documentation (http://git-scm.com/documentation)\nuseful, especially\nhttp://www.kernel.org/pub/software/scm/git/docs/everyday.html which\nhas your scenario under \"Push into another repository. \".\n\nIf you want someone to take some changes you made, it is recommended\nto let them know so that they can run 'git pull' or 'git fetch' to get\nyour changes (performing a merge or rebase as desired). This means\nthat they control when they get the updates and what they want to do\nwith them.\n\nIf you are committing the files to a shared public repository (e.g. a\ncentral repository, or build server repository), a pussible approach\nis to create that as a \"bare\" repository (one with just the contents\nof the .git folder - i.e. it does not have any files checked out). You\ncan do this by running:\n    git clone --bare source/git/path/project project.git\nyou can then clone from this:\n    git clone my/shared/project.git\nand push any changes to it as normal.\n\nThe build server can then do a 'git pull' to get the new changes from\nthat repository.\n\nYou can keep it setup like you currently have (assuming that where you\nare pushing to is a shared repository), and do:\n    git checkout HEAD\nbefore you run a build (assuming this is the repository that you are\nusing for your builds). The advantage of a bare repository is that it\nwill take up less space, and using a different (cloned) repository for\nperforming builds keeps the main repository clean.\n\nOne of the great things about git is that you can customise it to fit\ndifferent workflows.\n\nHTH,\n- Reece\n"},{"id":"101301","messageId":"49763D2B.1000607@morey-chaisemartin.com","threadId":"17274","inReplyTo":"3f4fd2640901201217x22262655w115cc2a25e32865e@mail.gmail.com","subject":"Re: Newbie Query","fromName":"Nicolas Morey-Chaisemartin","fromEmail":"devel@morey-chaisemartin.com","sentAt":"2009-01-20T21:07:55Z","receivedAt":"2009-01-20T21:07:55Z","isPatch":false,"sender":{"key":"devel@morey-chaisemartin.com","avatar":null},"body":"Reece Dunn a écrit :\n>\n> If you are committing the files to a shared public repository (e.g. a\n> central repository, or build server repository), a pussible approach\n> is to create that as a \"bare\" repository (one with just the contents\n> of the .git folder - i.e. it does not have any files checked out). You\n> can do this by running:\n>     git clone --bare source/git/path/project project.git\n> you can then clone from this:\n>     git clone my/shared/project.git\n> and push any changes to it as normal.\n>\n>   \nHi,\n\nI did the rookie mistkae on the central server to create the main\nreposity in non-bare mode. So i need to checkout the HEAD revision each\ntime I push.\nIs there a cleaner way to convert a non-bare git repo into a bare repo\nthan cloning it?\nMy repo have a lot of remote branch registered, and cloning them to a\nnew bare repo mean I'll have to add all those remote branches again\n(except if there is another trick here I don't know about).\n\nRegards\n\nNicolas\n"},{"id":"101307","messageId":"200901201534.16571.bss@iguanasuicide.net","threadId":"17274","inReplyTo":"49763D2B.1000607@morey-chaisemartin.com","subject":"Re: Newbie Query","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss@iguanasuicide.net","sentAt":"2009-01-20T21:34:12Z","receivedAt":"2009-01-20T21:34:12Z","isPatch":false,"sender":{"key":"bss@iguanasuicide.net","avatar":"https://gravatar.com/avatar/84b95eeff194b816c1568b1339e63e4b229825298664a9037b9f1ec713ead1e3?d=mp&s=160"},"body":"On Tuesday 2009 January 20 15:07:55 Nicolas Morey-Chaisemartin wrote:\n>I did the rookie mistkae on the central server to create the main\n>reposity in non-bare mode. So i need to checkout the HEAD revision each\n>time I push.\n>Is there a cleaner way to convert a non-bare git repo into a bare repo\n>than cloning it?\n>My repo have a lot of remote branch registered, and cloning them to a\n>new bare repo mean I'll have to add all those remote branches again\n>(except if there is another trick here I don't know about).\n\nWell, if you can make sure no one is pushing into the repo for a bit: clone it \nand replace the original with a symlink to new, bare one.  Your clients will \nbe able to use the same URL, so they should be happy.  (I haven't tried this, \nbut it should work.)\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss@iguanasuicide.net                     ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.net/                      \\_/     \n"},{"id":"101306","messageId":"49764647.1080606@morey-chaisemartin.com","threadId":"17274","inReplyTo":"200901201534.16571.bss@iguanasuicide.net","subject":"Re: Newbie Query","fromName":"Nicolas Morey-Chaisemartin","fromEmail":"devel@morey-chaisemartin.com","sentAt":"2009-01-20T21:46:47Z","receivedAt":"2009-01-20T21:46:47Z","isPatch":false,"sender":{"key":"devel@morey-chaisemartin.com","avatar":null},"body":"Boyd Stephen Smith Jr. a écrit :\n> On Tuesday 2009 January 20 15:07:55 Nicolas Morey-Chaisemartin wrote:\n>   \n>> I did the rookie mistkae on the central server to create the main\n>> reposity in non-bare mode. So i need to checkout the HEAD revision each\n>> time I push.\n>> Is there a cleaner way to convert a non-bare git repo into a bare repo\n>> than cloning it?\n>> My repo have a lot of remote branch registered, and cloning them to a\n>> new bare repo mean I'll have to add all those remote branches again\n>> (except if there is another trick here I don't know about).\n>>     \n>\n> Well, if you can make sure no one is pushing into the repo for a bit: clone it \n> and replace the original with a symlink to new, bare one.  Your clients will \n> be able to use the same URL, so they should be happy.  (I haven't tried this, \n> but it should work.)\n>   \nWell I know there are solutions to convert it to a bare repo.\nI was just wondering if there was a \"clean\" one which really converts\nthe repo to a bare one and not create a copy which is bare.\nI don't know how bare/non-bare is managed but I guess both types of repo\nare not differing by much, so it'd be great to have a function to\nconvert from one to another.\n"},{"id":"101310","messageId":"200901201624.30131.bss@iguanasuicide.net","threadId":"17274","inReplyTo":"49764647.1080606@morey-chaisemartin.com","subject":"Re: Newbie Query","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss@iguanasuicide.net","sentAt":"2009-01-20T22:24:25Z","receivedAt":"2009-01-20T22:24:25Z","isPatch":false,"sender":{"key":"bss@iguanasuicide.net","avatar":"https://gravatar.com/avatar/84b95eeff194b816c1568b1339e63e4b229825298664a9037b9f1ec713ead1e3?d=mp&s=160"},"body":"On Tuesday 2009 January 20 15:46:47 Nicolas Morey-Chaisemartin wrote:\n>Boyd Stephen Smith Jr. a écrit :\n>> On Tuesday 2009 January 20 15:07:55 Nicolas Morey-Chaisemartin wrote:\n>>> I did the rookie mistkae on the central server to create the main\n>>> reposity in non-bare mode.\n>>> Is there a cleaner way to convert a non-bare git repo into a bare repo\n>>> than cloning it?\n\nNo.\n\n>>> My repo have a lot of remote branch registered, and cloning them to a\n>>> new bare repo mean I'll have to add all those remote branches again\n>>> (except if there is another trick here I don't know about).\n>>\n>> Well, if you can make sure no one is pushing into the repo for a bit:\n>> clone it and replace the original with a symlink to new, bare one.  Your\n>> clients will be able to use the same URL, so they should be happy.  (I\n>> haven't tried this, but it should work.)\n>\n>Well I know there are solutions to convert it to a bare repo.\n>I was just wondering if there was a \"clean\" one which really converts\n>the repo to a bare one and not create a copy which is bare.\n\nThe clone *is* a way to convert, with the added advantage of not trashing the \noriginal during the conversion, by putting the results in a different \nlocation.  In fact, it's probably *cleaner* than any convert-in-place.\n\n>I don't know how bare/non-bare is managed but I guess both types of repo\n>are not differing by much, so it'd be great to have a function to\n>convert from one to another.\n\nI couldn't tell you all the differences, but I don't think there are many \neither.\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss@iguanasuicide.net                     ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.net/                      \\_/     \n"},{"id":"101318","messageId":"20090120235125.GD17746@coredump.intra.peff.net","threadId":"17274","inReplyTo":"49764647.1080606@morey-chaisemartin.com","subject":"Re: Newbie Query","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-01-20T23:51:25Z","receivedAt":"2009-01-20T23:51:25Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jan 20, 2009 at 10:46:47PM +0100, Nicolas Morey-Chaisemartin wrote:\n\n> Well I know there are solutions to convert it to a bare repo.\n> I was just wondering if there was a \"clean\" one which really converts\n> the repo to a bare one and not create a copy which is bare.\n\nIt has been a long time since I have done this. It used to be that you\ncould simply \"mv foo/.git foo.git\" and be done with it. These days I\nthink you would also need \"git config core.bare true\". But I haven't\nactually tested it recently.\n\nYou may also want to tweak other config settings (e.g., bare\nrepositories do not generally have reflogs turned on, but non-bare do).\n\n-Peff\n"},{"id":"101320","messageId":"alpine.DEB.1.00.0901210103100.19014@racer","threadId":"17274","inReplyTo":"20090120235125.GD17746@coredump.intra.peff.net","subject":"Re: Newbie Query","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-21T00:05:18Z","receivedAt":"2009-01-21T00:05:18Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 20 Jan 2009, Jeff King wrote:\n\n> On Tue, Jan 20, 2009 at 10:46:47PM +0100, Nicolas Morey-Chaisemartin wrote:\n> \n> > Well I know there are solutions to convert it to a bare repo.\n> > I was just wondering if there was a \"clean\" one which really converts\n> > the repo to a bare one and not create a copy which is bare.\n> \n> It has been a long time since I have done this. It used to be that you \n> could simply \"mv foo/.git foo.git\" and be done with it. These days I \n> think you would also need \"git config core.bare true\". But I haven't \n> actually tested it recently.\n\nYep, you need to set that option.  At least if you initialized your \nrepository with anything newer than v1.5.0-rc1~3^2~2.\n\nCiao,\nDscho\n"},{"id":"101383","messageId":"20090121143113.GA14004@uts.thewillards.local","threadId":"17274","inReplyTo":"20090120191952.GA25322@uts.thewillards.local","subject":"Re: Newbie Query","fromName":"Chris Willard","fromEmail":"chris@thewillards.co.uk","sentAt":"2009-01-21T14:31:13Z","receivedAt":"2009-01-21T14:31:13Z","isPatch":false,"sender":{"key":"chris@thewillards.co.uk","avatar":null},"body":"On Tue, 20 Jan 2009, Chris Willard wrote:\n\n> Hello All,\n> \n> I am having a go at using git and need a bit of help.\n[snip]\n\nThanks for all the tips - I used \"git-reset --hard\" to solve my\nproblem.\n\nRegards,\n\nChris\n\n\n-- \n-----------(  \"The Batman play seemed important to Crow.\" --  )------------\n-----------(                   Mike Nelson                    )------------\nChris -----(                                                  )---- Willard\n                             Htag.pl 0.0.23\n\n--\nThis message was scanned by ESVA and is believed to be clean.\n"}]}