{"thread":{"id":"30031","subject":"Push from specific directory.","startedAt":"2012-03-22T22:04:20Z","lastAt":"2012-03-26T14:41:51Z","messageCount":11,"participants":["Anjib Mulepati","Jeff King","Neal Kreitzinger","Junio C Hamano","Holger Hellmuth"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"187533","messageId":"BLU0-SMTP471329E4F80CD64A569A4F7B1410@phx.gbl","threadId":"30031","inReplyTo":null,"subject":"Push from specific directory.","fromName":"Anjib Mulepati","fromEmail":"anjibcs@hotmail.com","sentAt":"2012-03-22T22:04:20Z","receivedAt":"2012-03-22T22:04:20Z","isPatch":false,"sender":{"key":"anjibcs@hotmail.com","avatar":"https://gravatar.com/avatar/7ac86efaee717c505c8eaabde7f28e645eae076024b9761dc426b6b77ff4f2a0?d=mp&s=160"},"body":"Hi All\n\nI am starting using Git and few queries about it.\n1. Is it always necessary to be in root directory to do the push?\n2. Can I have a folder structure like\n         (a) /Hello-World\n         (b) /Hello-World/gitVersion/GitVersionFile.txt and\n         (c) /Hello-World/nonGitVersion/NonGitVersionFile.txt\nwhere I give git init for (a) and (c). If Itry to push only from (c) is \nthat valid?\n\nThanks,\nAnjib\n"},{"id":"187538","messageId":"20120322225747.GB14874@sigill.intra.peff.net","threadId":"30031","inReplyTo":"BLU0-SMTP471329E4F80CD64A569A4F7B1410@phx.gbl","subject":"Re: Push from specific directory.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-22T22:57:47Z","receivedAt":"2012-03-22T22:57:47Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Mar 22, 2012 at 06:04:20PM -0400, Anjib Mulepati wrote:\n\n> 1. Is it always necessary to be in root directory to do the push?\n\nNo. You are pushing whole commits, not a particular subset of your\nworking tree. So doing it from anywhere in the repository should have\nthe same effect.\n\nBut...\n\n> 2. Can I have a folder structure like\n>         (a) /Hello-World\n>         (b) /Hello-World/gitVersion/GitVersionFile.txt and\n>         (c) /Hello-World/nonGitVersion/NonGitVersionFile.txt\n> where I give git init for (a) and (c). If Itry to push only from (c)\n> is that valid?\n\nYou have a repository inside a repository. So when you are in (c), you\nwill be pushing the commits from (c), not from (a). I'm not really sure\nwhat you are trying to accomplish with that.\n\n-Peff\n"},{"id":"187541","messageId":"4F6BB425.2010807@gmail.com","threadId":"30031","inReplyTo":"20120322225747.GB14874@sigill.intra.peff.net","subject":"Re: Push from specific directory.","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2012-03-22T23:22:13Z","receivedAt":"2012-03-22T23:22:13Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 3/22/2012 5:57 PM, Jeff King wrote:\n> On Thu, Mar 22, 2012 at 06:04:20PM -0400, Anjib Mulepati wrote:\n>\n>> 2. Can I have a folder structure like (a) /Hello-World (b)\n>> /Hello-World/gitVersion/GitVersionFile.txt and (c)\n>> /Hello-World/nonGitVersion/NonGitVersionFile.txt where I give git\n>> init for (a) and (c). If Itry to push only from (c) is that valid?\n>\n> You have a repository inside a repository. So when you are in (c),\n> you will be pushing the commits from (c), not from (a). I'm not\n> really sure what you are trying to accomplish with that.\n>\nSee this thread for the \"cons\" of nested git repos: (I don't think there \nare any \"pros\".)\nhttp://thread.gmane.org/gmane.comp.version-control.git/190372\n\n*If* that is really what you meant...\n\nv/r,\nneal\n"},{"id":"187543","messageId":"20120322232723.GA15676@sigill.intra.peff.net","threadId":"30031","inReplyTo":"4F6BB425.2010807@gmail.com","subject":"Re: Push from specific directory.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-03-22T23:27:23Z","receivedAt":"2012-03-22T23:27:23Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Mar 22, 2012 at 06:22:13PM -0500, Neal Kreitzinger wrote:\n\n> >You have a repository inside a repository. So when you are in (c),\n> >you will be pushing the commits from (c), not from (a). I'm not\n> >really sure what you are trying to accomplish with that.\n> >\n> See this thread for the \"cons\" of nested git repos: (I don't think\n> there are any \"pros\".)\n> http://thread.gmane.org/gmane.comp.version-control.git/190372\n\nNested git repos are OK. I use one inside my git.git checkout to hold\nmeta-information and scripts (and I know Junio does the same thing). But\nI mark the sub-repository as ignored in the parent repository.  What's\ninsane is trying to track the same set of files from two different\nrepositories. And I think that is the confusing case in the thread you\nmentioned.\n\n-Peff\n"},{"id":"187545","messageId":"7vlimsur95.fsf@alter.siamese.dyndns.org","threadId":"30031","inReplyTo":"4F6BB425.2010807@gmail.com","subject":"Re: Push from specific directory.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-22T23:53:42Z","receivedAt":"2012-03-22T23:53:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Neal Kreitzinger <nkreitzinger@gmail.com> writes:\n\n> See this thread for the \"cons\" of nested git repos: (I don't think\n> there are any \"pros\".)\n> http://thread.gmane.org/gmane.comp.version-control.git/190372\n\nHmph, I see you saying \"I will keep this in mind\" and \"Thanks\" at the end,\nand back then I took it that you understood why/how nested working trees\nare useful.  Perhaps you didn't and I misunderstood you?\n"},{"id":"187546","messageId":"4F6BBC2D.10204@gmail.com","threadId":"30031","inReplyTo":"20120322232723.GA15676@sigill.intra.peff.net","subject":"Re: Push from specific directory.","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2012-03-22T23:56:29Z","receivedAt":"2012-03-22T23:56:29Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 3/22/2012 6:27 PM, Jeff King wrote:\n> On Thu, Mar 22, 2012 at 06:22:13PM -0500, Neal Kreitzinger wrote:\n>\n>>> You have a repository inside a repository. So when you are in (c),\n>>> you will be pushing the commits from (c), not from (a). I'm not\n>>> really sure what you are trying to accomplish with that.\n>>>\n>> See this thread for the \"cons\" of nested git repos: (I don't think\n>> there are any \"pros\".)\n>> http://thread.gmane.org/gmane.comp.version-control.git/190372\n>\n> Nested git repos are OK. I use one inside my git.git checkout to hold\n> meta-information and scripts (and I know Junio does the same thing). But\n> I mark the sub-repository as ignored in the parent repository.  What's\n> insane is trying to track the same set of files from two different\n> repositories. And I think that is the confusing case in the thread you\n> mentioned.\n>\nYes, hopefully the nested git repo is ignored by the higher level git\nrepo.  However, if it was ignored I don't suspect one would be wondering\nif it was ok to \"only\" push from the nested repo.  I could be wrong.\n\nv/r,\nneal\n"},{"id":"187549","messageId":"4F6BBF4F.9080302@gmail.com","threadId":"30031","inReplyTo":"7vlimsur95.fsf@alter.siamese.dyndns.org","subject":"Re: Push from specific directory.","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2012-03-23T00:09:51Z","receivedAt":"2012-03-23T00:09:51Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 3/22/2012 6:53 PM, Junio C Hamano wrote:\n> Neal Kreitzinger<nkreitzinger@gmail.com>  writes:\n>\n>> See this thread for the \"cons\" of nested git repos: (I don't think\n>> there are any \"pros\".)\n>> http://thread.gmane.org/gmane.comp.version-control.git/190372\n>\n> Hmph, I see you saying \"I will keep this in mind\" and \"Thanks\" at the end,\n> and back then I took it that you understood why/how nested working trees\n> are useful.  Perhaps you didn't and I misunderstood you?\n\nI neglected to distinguish between ignored-nested-git-repos (has pros) \nand tracked-subdir-nested-git-repos (has no pros) in my preface to the \nthread link.  That was an oversight on my part.\n\nBTW, I'm am still being compelled to deal with \ntracked-subdir-nested-git-repos and I have not found any pros to them so \nyour original assessment of that technique still stands. ;-)\n\nv/r,\nneal\n"},{"id":"187552","messageId":"4F6BD1E2.2050607@gmail.com","threadId":"30031","inReplyTo":"20120322225747.GB14874@sigill.intra.peff.net","subject":"Re: Push from specific directory.","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2012-03-23T01:29:06Z","receivedAt":"2012-03-23T01:29:06Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 3/22/2012 5:57 PM, Jeff King wrote:\n> On Thu, Mar 22, 2012 at 06:04:20PM -0400, Anjib Mulepati wrote:\n>\n>> 2. Can I have a folder structure like (a) /Hello-World (b)\n>> /Hello-World/gitVersion/GitVersionFile.txt and (c)\n>> /Hello-World/nonGitVersion/NonGitVersionFile.txt where I give git\n>> init for (a) and (c). If Itry to push only from (c) is that valid?\n>\n> You have a repository inside a repository. So when you are in (c),\n> you will be pushing the commits from (c), not from (a). I'm not\n> really sure what you are trying to accomplish with that.\n>\nIt almost looks like he might be tracking his git installation with git\nby tracking the \"gitVersion\" dir, and the \"NonGitVersion\" dir is really \nthe \"normal\" git repo containing a dev project.  I'm probably making a \nmisinterpretation of the wording and \"gitVersion\" means \"stuff versioned \nby git\", but then again \"NonGitVersion\" is also supposedly being \nversioned by git.  Just curious if he's attempting to use his git \ninstallation to track itself which would be interesting also.\n\nv/r,\nneal\n"},{"id":"187577","messageId":"4F6C970B.2010803@gmail.com","threadId":"30031","inReplyTo":"BLU0-SMTP315865C5026D08E76594E5DB1460@phx.gbl","subject":"Re: Push from specific directory.","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2012-03-23T15:30:19Z","receivedAt":"2012-03-23T15:30:19Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 3/23/2012 8:35 AM, Anjib Mulepati wrote:\n> I  am comparing Git with other SVN.\n>\n> In SVN each folders have .svn folder. If we don't wanna track \n> particular folder then there is no .svn folder in that directory. In \n> Git does we have same structure?\n>\n> So the example I am giving here represent two versions and one \n> non-version folder.\n>\nThere is only one .git dir per git repo.  By default it is created under \nthe top-level dir (worktree) of the repo.  If you don't want to track a \nsubdir then you ignore it using the gitignore technology of git.  You \nwould want to setup the gitignore before doing the init.\n\nv/r,\nneal\n"},{"id":"187721","messageId":"4F707CB4.3030308@ira.uka.de","threadId":"30031","inReplyTo":"4F6C970B.2010803@gmail.com","subject":"Re: Push from specific directory.","fromName":"Holger Hellmuth","fromEmail":"hellmuth@ira.uka.de","sentAt":"2012-03-26T14:27:00Z","receivedAt":"2012-03-26T14:27:00Z","isPatch":false,"sender":{"key":"hellmuth@ira.uka.de","avatar":null},"body":"On 23.03.2012 16:30, Neal Kreitzinger wrote:\n\n> You would want to setup the gitignore before doing the init.\n\nWhy that? \"git init\" doesn't add any files, the repo is still empty.\n\nI would even say \"git init\" helps because you get a comprehensive list \nof non-ignored files with \"git status\" and can sift through that list \nfor files you want to be ignored\n"},{"id":"187724","messageId":"4F70802F.4020603@gmail.com","threadId":"30031","inReplyTo":"4F707CB4.3030308@ira.uka.de","subject":"Re: Push from specific directory.","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2012-03-26T14:41:51Z","receivedAt":"2012-03-26T14:41:51Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 3/26/2012 9:27 AM, Holger Hellmuth wrote:\n> On 23.03.2012 16:30, Neal Kreitzinger wrote:\n>\n>> You would want to setup the gitignore before doing the init.\n>\n> Why that? \"git init\" doesn't add any files, the repo is still empty.\n>\n> I would even say \"git init\" helps because you get a comprehensive list \n> of non-ignored files with \"git status\" and can sift through that list \n> for files you want to be ignored\n>\n>\nThanks for correcting that.\n\nv/r,\nneal\n"}]}