All of lore.kernel.org
 help / color / mirror / Atom feed
* Push from specific directory.
@ 2012-03-22 22:04 Anjib Mulepati
  2012-03-22 22:57 ` Jeff King
  0 siblings, 1 reply; 11+ messages in thread
From: Anjib Mulepati @ 2012-03-22 22:04 UTC (permalink / raw)
  To: git

Hi All

I am starting using Git and few queries about it.
1. Is it always necessary to be in root directory to do the push?
2. Can I have a folder structure like
         (a) /Hello-World
         (b) /Hello-World/gitVersion/GitVersionFile.txt and
         (c) /Hello-World/nonGitVersion/NonGitVersionFile.txt
where I give git init for (a) and (c). If Itry to push only from (c) is 
that valid?

Thanks,
Anjib

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Push from specific directory.
  2012-03-22 22:04 Push from specific directory Anjib Mulepati
@ 2012-03-22 22:57 ` Jeff King
  2012-03-22 23:22   ` Neal Kreitzinger
  2012-03-23  1:29   ` Neal Kreitzinger
  0 siblings, 2 replies; 11+ messages in thread
From: Jeff King @ 2012-03-22 22:57 UTC (permalink / raw)
  To: Anjib Mulepati; +Cc: git

On Thu, Mar 22, 2012 at 06:04:20PM -0400, Anjib Mulepati wrote:

> 1. Is it always necessary to be in root directory to do the push?

No. You are pushing whole commits, not a particular subset of your
working tree. So doing it from anywhere in the repository should have
the same effect.

But...

> 2. Can I have a folder structure like
>         (a) /Hello-World
>         (b) /Hello-World/gitVersion/GitVersionFile.txt and
>         (c) /Hello-World/nonGitVersion/NonGitVersionFile.txt
> where I give git init for (a) and (c). If Itry to push only from (c)
> is that valid?

You have a repository inside a repository. So when you are in (c), you
will be pushing the commits from (c), not from (a). I'm not really sure
what you are trying to accomplish with that.

-Peff

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Push from specific directory.
  2012-03-22 22:57 ` Jeff King
@ 2012-03-22 23:22   ` Neal Kreitzinger
  2012-03-22 23:27     ` Jeff King
  2012-03-22 23:53     ` Junio C Hamano
  2012-03-23  1:29   ` Neal Kreitzinger
  1 sibling, 2 replies; 11+ messages in thread
From: Neal Kreitzinger @ 2012-03-22 23:22 UTC (permalink / raw)
  To: Jeff King; +Cc: Anjib Mulepati, git

On 3/22/2012 5:57 PM, Jeff King wrote:
> On Thu, Mar 22, 2012 at 06:04:20PM -0400, Anjib Mulepati wrote:
>
>> 2. Can I have a folder structure like (a) /Hello-World (b)
>> /Hello-World/gitVersion/GitVersionFile.txt and (c)
>> /Hello-World/nonGitVersion/NonGitVersionFile.txt where I give git
>> init for (a) and (c). If Itry to push only from (c) is that valid?
>
> You have a repository inside a repository. So when you are in (c),
> you will be pushing the commits from (c), not from (a). I'm not
> really sure what you are trying to accomplish with that.
>
See this thread for the "cons" of nested git repos: (I don't think there 
are any "pros".)
http://thread.gmane.org/gmane.comp.version-control.git/190372

*If* that is really what you meant...

v/r,
neal

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Push from specific directory.
  2012-03-22 23:22   ` Neal Kreitzinger
@ 2012-03-22 23:27     ` Jeff King
  2012-03-22 23:56       ` Neal Kreitzinger
  2012-03-22 23:53     ` Junio C Hamano
  1 sibling, 1 reply; 11+ messages in thread
From: Jeff King @ 2012-03-22 23:27 UTC (permalink / raw)
  To: Neal Kreitzinger; +Cc: Anjib Mulepati, git

On Thu, Mar 22, 2012 at 06:22:13PM -0500, Neal Kreitzinger wrote:

> >You have a repository inside a repository. So when you are in (c),
> >you will be pushing the commits from (c), not from (a). I'm not
> >really sure what you are trying to accomplish with that.
> >
> See this thread for the "cons" of nested git repos: (I don't think
> there are any "pros".)
> http://thread.gmane.org/gmane.comp.version-control.git/190372

Nested git repos are OK. I use one inside my git.git checkout to hold
meta-information and scripts (and I know Junio does the same thing). But
I mark the sub-repository as ignored in the parent repository.  What's
insane is trying to track the same set of files from two different
repositories. And I think that is the confusing case in the thread you
mentioned.

-Peff

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Push from specific directory.
  2012-03-22 23:22   ` Neal Kreitzinger
  2012-03-22 23:27     ` Jeff King
@ 2012-03-22 23:53     ` Junio C Hamano
  2012-03-23  0:09       ` Neal Kreitzinger
  1 sibling, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2012-03-22 23:53 UTC (permalink / raw)
  To: Neal Kreitzinger; +Cc: Jeff King, Anjib Mulepati, git

Neal Kreitzinger <nkreitzinger@gmail.com> writes:

> See this thread for the "cons" of nested git repos: (I don't think
> there are any "pros".)
> http://thread.gmane.org/gmane.comp.version-control.git/190372

Hmph, I see you saying "I will keep this in mind" and "Thanks" at the end,
and back then I took it that you understood why/how nested working trees
are useful.  Perhaps you didn't and I misunderstood you?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Push from specific directory.
  2012-03-22 23:27     ` Jeff King
@ 2012-03-22 23:56       ` Neal Kreitzinger
  0 siblings, 0 replies; 11+ messages in thread
From: Neal Kreitzinger @ 2012-03-22 23:56 UTC (permalink / raw)
  To: Jeff King; +Cc: Anjib Mulepati, git, Junio C Hamano

On 3/22/2012 6:27 PM, Jeff King wrote:
> On Thu, Mar 22, 2012 at 06:22:13PM -0500, Neal Kreitzinger wrote:
>
>>> You have a repository inside a repository. So when you are in (c),
>>> you will be pushing the commits from (c), not from (a). I'm not
>>> really sure what you are trying to accomplish with that.
>>>
>> See this thread for the "cons" of nested git repos: (I don't think
>> there are any "pros".)
>> http://thread.gmane.org/gmane.comp.version-control.git/190372
>
> Nested git repos are OK. I use one inside my git.git checkout to hold
> meta-information and scripts (and I know Junio does the same thing). But
> I mark the sub-repository as ignored in the parent repository.  What's
> insane is trying to track the same set of files from two different
> repositories. And I think that is the confusing case in the thread you
> mentioned.
>
Yes, hopefully the nested git repo is ignored by the higher level git
repo.  However, if it was ignored I don't suspect one would be wondering
if it was ok to "only" push from the nested repo.  I could be wrong.

v/r,
neal

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Push from specific directory.
  2012-03-22 23:53     ` Junio C Hamano
@ 2012-03-23  0:09       ` Neal Kreitzinger
  0 siblings, 0 replies; 11+ messages in thread
From: Neal Kreitzinger @ 2012-03-23  0:09 UTC (permalink / raw)
  To: git; +Cc: Jeff King, Anjib Mulepati

On 3/22/2012 6:53 PM, Junio C Hamano wrote:
> Neal Kreitzinger<nkreitzinger@gmail.com>  writes:
>
>> See this thread for the "cons" of nested git repos: (I don't think
>> there are any "pros".)
>> http://thread.gmane.org/gmane.comp.version-control.git/190372
>
> Hmph, I see you saying "I will keep this in mind" and "Thanks" at the end,
> and back then I took it that you understood why/how nested working trees
> are useful.  Perhaps you didn't and I misunderstood you?

I neglected to distinguish between ignored-nested-git-repos (has pros) 
and tracked-subdir-nested-git-repos (has no pros) in my preface to the 
thread link.  That was an oversight on my part.

BTW, I'm am still being compelled to deal with 
tracked-subdir-nested-git-repos and I have not found any pros to them so 
your original assessment of that technique still stands. ;-)

v/r,
neal

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Push from specific directory.
  2012-03-22 22:57 ` Jeff King
  2012-03-22 23:22   ` Neal Kreitzinger
@ 2012-03-23  1:29   ` Neal Kreitzinger
       [not found]     ` <BLU0-SMTP315865C5026D08E76594E5DB1460@phx.gbl>
  1 sibling, 1 reply; 11+ messages in thread
From: Neal Kreitzinger @ 2012-03-23  1:29 UTC (permalink / raw)
  To: Jeff King; +Cc: Anjib Mulepati, git

On 3/22/2012 5:57 PM, Jeff King wrote:
> On Thu, Mar 22, 2012 at 06:04:20PM -0400, Anjib Mulepati wrote:
>
>> 2. Can I have a folder structure like (a) /Hello-World (b)
>> /Hello-World/gitVersion/GitVersionFile.txt and (c)
>> /Hello-World/nonGitVersion/NonGitVersionFile.txt where I give git
>> init for (a) and (c). If Itry to push only from (c) is that valid?
>
> You have a repository inside a repository. So when you are in (c),
> you will be pushing the commits from (c), not from (a). I'm not
> really sure what you are trying to accomplish with that.
>
It almost looks like he might be tracking his git installation with git
by tracking the "gitVersion" dir, and the "NonGitVersion" dir is really 
the "normal" git repo containing a dev project.  I'm probably making a 
misinterpretation of the wording and "gitVersion" means "stuff versioned 
by git", but then again "NonGitVersion" is also supposedly being 
versioned by git.  Just curious if he's attempting to use his git 
installation to track itself which would be interesting also.

v/r,
neal

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Push from specific directory.
       [not found]     ` <BLU0-SMTP315865C5026D08E76594E5DB1460@phx.gbl>
@ 2012-03-23 15:30       ` Neal Kreitzinger
  2012-03-26 14:27         ` Holger Hellmuth
  0 siblings, 1 reply; 11+ messages in thread
From: Neal Kreitzinger @ 2012-03-23 15:30 UTC (permalink / raw)
  To: Anjib Mulepati; +Cc: git

On 3/23/2012 8:35 AM, Anjib Mulepati wrote:
> I  am comparing Git with other SVN.
>
> In SVN each folders have .svn folder. If we don't wanna track 
> particular folder then there is no .svn folder in that directory. In 
> Git does we have same structure?
>
> So the example I am giving here represent two versions and one 
> non-version folder.
>
There is only one .git dir per git repo.  By default it is created under 
the top-level dir (worktree) of the repo.  If you don't want to track a 
subdir then you ignore it using the gitignore technology of git.  You 
would want to setup the gitignore before doing the init.

v/r,
neal

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Push from specific directory.
  2012-03-23 15:30       ` Neal Kreitzinger
@ 2012-03-26 14:27         ` Holger Hellmuth
  2012-03-26 14:41           ` Neal Kreitzinger
  0 siblings, 1 reply; 11+ messages in thread
From: Holger Hellmuth @ 2012-03-26 14:27 UTC (permalink / raw)
  To: Neal Kreitzinger; +Cc: Anjib Mulepati, git

On 23.03.2012 16:30, Neal Kreitzinger wrote:

> You would want to setup the gitignore before doing the init.

Why that? "git init" doesn't add any files, the repo is still empty.

I would even say "git init" helps because you get a comprehensive list 
of non-ignored files with "git status" and can sift through that list 
for files you want to be ignored

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Push from specific directory.
  2012-03-26 14:27         ` Holger Hellmuth
@ 2012-03-26 14:41           ` Neal Kreitzinger
  0 siblings, 0 replies; 11+ messages in thread
From: Neal Kreitzinger @ 2012-03-26 14:41 UTC (permalink / raw)
  To: Holger Hellmuth; +Cc: Anjib Mulepati, git

On 3/26/2012 9:27 AM, Holger Hellmuth wrote:
> On 23.03.2012 16:30, Neal Kreitzinger wrote:
>
>> You would want to setup the gitignore before doing the init.
>
> Why that? "git init" doesn't add any files, the repo is still empty.
>
> I would even say "git init" helps because you get a comprehensive list 
> of non-ignored files with "git status" and can sift through that list 
> for files you want to be ignored
>
>
Thanks for correcting that.

v/r,
neal

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-03-26 14:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-22 22:04 Push from specific directory Anjib Mulepati
2012-03-22 22:57 ` Jeff King
2012-03-22 23:22   ` Neal Kreitzinger
2012-03-22 23:27     ` Jeff King
2012-03-22 23:56       ` Neal Kreitzinger
2012-03-22 23:53     ` Junio C Hamano
2012-03-23  0:09       ` Neal Kreitzinger
2012-03-23  1:29   ` Neal Kreitzinger
     [not found]     ` <BLU0-SMTP315865C5026D08E76594E5DB1460@phx.gbl>
2012-03-23 15:30       ` Neal Kreitzinger
2012-03-26 14:27         ` Holger Hellmuth
2012-03-26 14:41           ` Neal Kreitzinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.