{"thread":{"id":"22945","subject":"How do you add an external directory to repository?","startedAt":"2010-03-07T20:03:49Z","lastAt":"2010-03-07T21:36:24Z","messageCount":3,"participants":["slipstream180","Fredrik Gustafsson","Nicolas Sebrecht"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"136349","messageId":"1267992229319-4691734.post@n2.nabble.com","threadId":"22945","inReplyTo":null,"subject":"How do you add an external directory to repository?","fromName":"slipstream180","fromEmail":"ivan.barrios@gmail.com","sentAt":"2010-03-07T20:03:49Z","receivedAt":"2010-03-07T20:03:49Z","isPatch":false,"sender":{"key":"ivan.barrios@gmail.com","avatar":null},"body":"\nI want to add an external directory to an existing repository.\n\nExternal Dir: /home/some/directory\n\nWorking Dir: /htdocs/.git\n\nIf I attempt the following command from the /htdocs dir:\n\ngit add /home/some/directory\n\nI get an error: fatal: '/home/some/directory' is outside repository\n\nI understand that I can add a symbolic link to /home/some/directory, but I\nbelieve that only track the link. How do I track all files under the\ndirectory as well?\n\nThanks in advance!\n\n-- \nView this message in context: http://n2.nabble.com/How-do-you-add-an-external-directory-to-repository-tp4691734p4691734.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"136351","messageId":"20100307202302.GB19693@iveqy.com","threadId":"22945","inReplyTo":"1267992229319-4691734.post@n2.nabble.com","subject":"Re: How do you add an external directory to repository?","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2010-03-07T20:23:02Z","receivedAt":"2010-03-07T20:23:02Z","isPatch":false,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Sun, Mar 07, 2010 at 12:03:49PM -0800, slipstream180 wrote:\n> \n> I want to add an external directory to an existing repository.\nI'm unsure if that can be done, I don't think so.\n\nI do, however, believe that the superproject functionality can suite\nyour needs. Then you will have two git repositories, one wich is\nhandling the other.\n\nIt sounds really more complicated than it is.\n\nhttp://en.wikibooks.org/wiki/Git/Submodules_and_Superprojects\n\nregards\niveqy\n"},{"id":"136360","messageId":"20100307213624.GA12937@vidovic","threadId":"22945","inReplyTo":"1267992229319-4691734.post@n2.nabble.com","subject":"Re: How do you add an external directory to repository?","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s.dev@gmx.fr","sentAt":"2010-03-07T21:36:24Z","receivedAt":"2010-03-07T21:36:24Z","isPatch":false,"sender":{"key":"nicolas.s.dev@gmx.fr","avatar":null},"body":"The 07/03/10, slipstream180 wrote:\n\n> I understand that I can add a symbolic link to /home/some/directory, but I\n> believe that only track the link. How do I track all files under the\n> directory as well?\n\nI think you're looking for the bind option of mount. This is what I use\nto track all my configuration files in one \"conf\" repository.\n\nHere is an extract of how my fstab looks like:\n\n  /home/nicolas/.zsh /home/nicolas/dev/conf/zsh\t\t\t\tauto\tbind,user\t0 0 \n  /home/nicolas/.vim /home/nicolas/dev/conf/vim\t\t\t\tauto\tbind,user\t0 0 \n  /home/nicolas/.mutt /home/nicolas/dev/conf/mutt\t\t\t\tauto\tbind,user\t0 0 \n  /home/nicolas/.screen /home/nicolas/dev/conf/screen\t\t\tauto\tbind,user\t0 0 \n  /home/nicolas/.offlineimapconf/ /home/nicolas/dev/conf/offlineimap\tauto\tbind,user\t0 0 \n\nI also use a symbolic link ~/.zshrc to .zsh/zshrc to track it too. This\nis very useful because one logical change may affect configuration files\nfrom various programs (e.g. have a new mailbox concerns mutt,\nofflineimap, imapfilter, and some other scripts of my own).\n\n\nAlso, I use this trick for web projects:\n\n  /home/nicolas/dev/wsb /var/www/localhost/htdocs/wsb\t\t\tauto\tbind,user\t0 0\n  \n\n-- \nNicolas Sebrecht\n"}]}