{"thread":{"id":"27804","subject":"Coming from SVN world - need help","startedAt":"2011-07-13T13:00:56Z","lastAt":"2011-07-14T06:08:14Z","messageCount":4,"participants":["J. Bakshi","Erik Faye-Lund","Ramkumar Ramachandra"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"171245","messageId":"20110713183056.1cde5b61@shiva.selfip.org","threadId":"27804","inReplyTo":null,"subject":"Coming from SVN world - need help","fromName":"J. Bakshi","fromEmail":"joydeep@infoservices.in","sentAt":"2011-07-13T13:00:56Z","receivedAt":"2011-07-13T13:00:56Z","isPatch":false,"sender":{"key":"joydeep@infoservices.in","avatar":null},"body":"Dear list,\n\nGreetings !!\n\nI have come from SVN world and totally new to GIT. I have managed to set gitweb and git; based on https:// along with authentication ( both for read and right ). And now I like to do the rest of the svn related thing in GIT. Just see the script below. This script first create an empty repo, built the structure; then checkout in a directory to map trunk with it and add contents to the repo.\n\n```````````````````\nsvnadmin create ${svn_path}/<repo>\n\nsvn mkdir file:///${svn_path}/<repo>/trunk  \\\n         file:///${svn_path}/<repo>/tags  \\\n         file:///${svn_path}/<repo>/branches \\\n         -m \"creating repo structure\"\n\n# map a directory with trunk \n\ncd mydir\nmydir $> svn --username ${admin_svn} --password ${admin_svn_pass} co  file:///${svn_path}/${name_site}/trunk ./\n\n#add and commit\nmydir $> svn  add dir1 dir2\n\n##commit\nmydir $> svn  commit -m \"adding dir1  dir2\"\nmydir $> svn up\n````````````````````````````````\n\nAnd now the issues when I am trying to do the same with git\n\n[1] git init ${git_path}/<repo>.git  >>> ok , it is working\n\n[2] Problem with mapping a dir with this repo\n\nmydir $> git --username <username> --password <password> clone file:///${git_path}/<repo>.git \n\nNot working --username and --password .\n\nAlso git clone file:///${git_path}/<repo>.git creates a folder <repo>.git where I like map  the working directory with the contents of <repo>.git\n\n[3] git commit -m also not commit into master.\n\nCould any one please give me some clue ?\n\nThanks\n"},{"id":"171247","messageId":"CABPQNSa1PO6je+4sXMRWLLwLG9sUNTD1a+SMJj=wdPF+_dUPHA@mail.gmail.com","threadId":"27804","inReplyTo":"20110713183056.1cde5b61@shiva.selfip.org","subject":"Re: Coming from SVN world - need help","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-07-13T13:17:36Z","receivedAt":"2011-07-13T13:17:36Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Wed, Jul 13, 2011 at 3:00 PM, J. Bakshi <joydeep@infoservices.in> wrote:\n> And now the issues when I am trying to do the same with git\n>\n> [1] git init ${git_path}/<repo>.git  >>> ok , it is working\n\nYou probably want to add the \"--bare\"-flag if this is the repo that\nwill be published.\n\n> [2] Problem with mapping a dir with this repo\n>\n> mydir $> git --username <username> --password <password> clone file:///${git_path}/<repo>.git\n>\n> Not working --username and --password .\n>\n\nYou don't need username and password to clone over the file-system,\njust the correct file-system permissions.\n\n> [3] git commit -m also not commit into master.\n\ngit commit -m\"foo\" commits into the local branch that HEAD points to\n(should be 'master' by default). You need to do \"git push\" to update\nthe published repo.\n"},{"id":"171305","messageId":"20110714110318.7726251c@shiva.selfip.org","threadId":"27804","inReplyTo":"CABPQNSa1PO6je+4sXMRWLLwLG9sUNTD1a+SMJj=wdPF+_dUPHA@mail.gmail.com","subject":"Re: Coming from SVN world - need help","fromName":"J. Bakshi","fromEmail":"joydeep@infoservices.in","sentAt":"2011-07-14T05:33:18Z","receivedAt":"2011-07-14T05:33:18Z","isPatch":false,"sender":{"key":"joydeep@infoservices.in","avatar":null},"body":"On Wed, 13 Jul 2011 15:17:36 +0200\nErik Faye-Lund <kusmabite@gmail.com> wrote:\n\n> On Wed, Jul 13, 2011 at 3:00 PM, J. Bakshi <joydeep@infoservices.in> wrote:\n> > And now the issues when I am trying to do the same with git\n> >\n> > [1] git init ${git_path}/<repo>.git  >>> ok , it is working\n> \n> You probably want to add the \"--bare\"-flag if this is the repo that\n> will be published.\n> \nActually the practical scenario is different than just a bare repo. The repos should be connected with its working copy located at htdocs directory. So whenever someone commit anything in git the corresponding working directory should be updated accordingly with a post-commit hook. I have done the same in svn but don't know how git will help to achieve this ? The main part, How can I simply map the folder in htdocs with it's master in git repo ? As \"git clone\" actually creates the parent folder. In svn it was easy with\n\n````````````\ncd mydir\nmydir $> svn --username ${admin_svn} --password ${admin_svn_pass} co  file:///${svn_path}/${name_site}/trunk ./\n``````````````\n\nHow can I achieve the same in git ?\n"},{"id":"171306","messageId":"CALkWK0nboCCGWhcKMgv6Y4FWgfsdhatEf78sSQCAMcKe2HU0FA@mail.gmail.com","threadId":"27804","inReplyTo":"20110714110318.7726251c@shiva.selfip.org","subject":"Re: Coming from SVN world - need help","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2011-07-14T06:08:14Z","receivedAt":"2011-07-14T06:08:14Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi Bakshi,\n\nJ. Bakshi writes:\n> Actually the practical scenario is different than just a bare repo. The repos should be connected with its working copy located at htdocs directory. So whenever someone commit anything in git the corresponding working directory should be updated accordingly with a post-commit hook. I have done the same in svn but don't know how git will help to achieve this ? The main part, How can I simply map the folder in htdocs with it's master in git repo ? As \"git clone\" actually creates the parent folder. In svn it was easy with\n\nIn the bare repo, set core.worktree to the htdocs directory*, and put\nsomething like this in your hooks/post-receive:\n#!/bin/sh\ngit checkout -f\n\n* For more, read about detached worktrees in Git\n\n-- Ram\n"}]}