POV-Ray : Newsgroups : povray.off-topic : Nope, I STILL don't understand git branches Server Time
4 Feb 2026 07:17:39 EST (-0500)
  Nope, I STILL don't understand git branches (Message 24 to 33 of 33)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bill Pragnell
Subject: Re: Nope, I STILL don't understand git branches
Date: 30 Jan 2026 21:45:00
Message: <web.697d6c01461f9d4e95258fa76f35e431@news.povray.org>
Jim Henderson <nos### [at] nospamcom> wrote:
> On Tue, 27 Jan 2026 10:02:14 -0400, Cousin Ricky wrote:
> > On 2026-01-26 02:00 (-4), Jim Henderson wrote:
> >> But it looks like the file is tracked, so any changes to it made in one
> >> branch shouldn't affect other branches,

Are we confusing our usage of 'change' perhaps? A 'change' to a file (in
git-speak) refers to an edit, without any git interaction, which is what I've
been assuming. A change to a branch is usually called a 'commit', and that will
indeed be unique to the branch.

> > I'm sensing disagreement in what "tracked" means.  Jim is using
> > "tracked" the way I've understood it, but Bill is describing the
> > behavior I'm seeing from git.

I think git itself may also be confusing the issue here. 'Tracked' just means
the file has been added to the repo. If I add a new file to a project (without
git interaction - just make a new file within a repo), it is listed as
'untracked' because it does not yet have an entry in the repo - its entire
contents are a 'change'. If I 'git add' and then 'git commit' that file, it is
then 'tracked' as part of that branch from that point on. But you could say that
even an 'untracked' file is tracked in the sense of git being aware of it,
because it appears in the status. Only files/directories in .gitignore are truly
untracked because edits to them will be ignored.

Uncommitted changes (i.e. edits to a file) will not be affected by switching
branches, unless there is a conflict - i.e. if the edits apply to a section of a
file that is different in the two branches. In that case, git will not switch
branches, but instead tell you to commit or 'stash' your changes before
switching (stashing is saving your changes on a temp stack rather than
committing them).

Sorry if I'm muddying the water here! I remember being quite confused about how
git worked when I first started using it.

Bill


Post a reply to this message

From: Jim Henderson
Subject: Re: Nope, I STILL don't understand git branches
Date: 31 Jan 2026 00:52:22
Message: <697d9896$1@news.povray.org>
On Fri, 30 Jan 2026 21:42:09 EST, Bill Pragnell wrote:

> Jim Henderson <nos### [at] nospamcom> wrote:
>> On Tue, 27 Jan 2026 10:02:14 -0400, Cousin Ricky wrote:
>> > On 2026-01-26 02:00 (-4), Jim Henderson wrote:
>> >> But it looks like the file is tracked, so any changes to it made in
>> >> one branch shouldn't affect other branches,
> 
> Are we confusing our usage of 'change' perhaps? A 'change' to a file (in
> git-speak) refers to an edit, without any git interaction, which is what
> I've been assuming. A change to a branch is usually called a 'commit',
> and that will indeed be unique to the branch.

No, that's what I'm calling a change - an edit to the file.

>> > I'm sensing disagreement in what "tracked" means.  Jim is using
>> > "tracked" the way I've understood it, but Bill is describing the
>> > behavior I'm seeing from git.
> 
> I think git itself may also be confusing the issue here. 'Tracked' just
> means the file has been added to the repo. If I add a new file to a
> project (without git interaction - just make a new file within a repo),
> it is listed as 'untracked' because it does not yet have an entry in the
> repo - its entire contents are a 'change'. If I 'git add' and then 'git
> commit' that file, it is then 'tracked' as part of that branch from that
> point on. But you could say that even an 'untracked' file is tracked in
> the sense of git being aware of it, because it appears in the status.
> Only files/directories in .gitignore are truly untracked because edits
> to them will be ignored.

Hmmm.  I just created a quick test repo, and it's not working the way I 
remembered it, but it is working the way you're describing and CR is 
saying is happening for his setup, too.

> Uncommitted changes (i.e. edits to a file) will not be affected by
> switching branches, unless there is a conflict - i.e. if the edits apply
> to a section of a file that is different in the two branches. In that
> case, git will not switch branches, but instead tell you to commit or
> 'stash' your changes before switching (stashing is saving your changes
> on a temp stack rather than committing them).

This is what I'm used to seeing.  But my usage generally had me making 
changes within a branch, not creating the branch myself, and then the 
developer who created the branch would merge things back (my main use case 
for this was years ago creating in-product text strings for documentation 
purposes - tooltips and the like).

I've used it a fair bit on my own since then, but generally haven't needed 
to branch since the stuff I'm using it for is all for my own amusement.

> Sorry if I'm muddying the water here! I remember being quite confused
> about how git worked when I first started using it.
> 
> Bill

No worries, you got me to actually try it and see, and it wasn't matching 
my memory.  Show now I need to figure out why my memory is different than 
what I actually saw in my simple test.



-- 
"I learned long ago, never to wrestle with a pig. You get dirty, and 
besides, the pig likes it." - George Bernard Shaw


Post a reply to this message

From: Jim Henderson
Subject: Re: Nope, I STILL don't understand git branches
Date: 31 Jan 2026 00:55:13
Message: <697d9941@news.povray.org>
On 31 Jan 2026 00:52:22 -0500, Jim Henderson wrote:

> This is what I'm used to seeing.  But my usage generally had me making
> changes within a branch, not creating the branch myself, and then the
> developer who created the branch would merge things back (my main use
> case for this was years ago creating in-product text strings for
> documentation purposes - tooltips and the like).

I think I understand better now - once I committed the changes to master, 
then the branch I created (test1) "reverted" to what was originally in the 
file when I branched it (ie, it was empty).



-- 
"I learned long ago, never to wrestle with a pig. You get dirty, and 
besides, the pig likes it." - George Bernard Shaw


Post a reply to this message

From: Jim Henderson
Subject: Re: Nope, I STILL don't understand git branches
Date: 31 Jan 2026 01:07:54
Message: <697d9c3a$1@news.povray.org>
On 31 Jan 2026 00:55:13 -0500, Jim Henderson wrote:

> On 31 Jan 2026 00:52:22 -0500, Jim Henderson wrote:
> 
>> This is what I'm used to seeing.  But my usage generally had me making
>> changes within a branch, not creating the branch myself, and then the
>> developer who created the branch would merge things back (my main use
>> case for this was years ago creating in-product text strings for
>> documentation purposes - tooltips and the like).
> 
> I think I understand better now - once I committed the changes to
> master, then the branch I created (test1) "reverted" to what was
> originally in the file when I branched it (ie, it was empty).

So it seems to be that once a file is modified and then committed to a 
branch, then changes to it will require a stash or commit before changing 
branches again.

I probably never ran into this since the files I was modifying had already 
been through many iterations by the time I saw them.  But it makes logical 
sense to me that each branch isn't a full copy of everything in the state 
at which it was first added, and that it would be consistent across 
branches until it was changed in one of them.

I'd guess that if a change were committed in 'branch1' and you switched 
back to 'master' where it wasn't committed, and created a new branch 
'branch2', that the behavior would be consistent as well, at least until 
'branch1' was merged back into 'master'.



-- 
"I learned long ago, never to wrestle with a pig. You get dirty, and 
besides, the pig likes it." - George Bernard Shaw


Post a reply to this message

From: Cousin Ricky
Subject: Re: Nope, I STILL don't understand git branches
Date: 1 Feb 2026 00:08:42
Message: <697edfda$1@news.povray.org>
On 2026-01-30 22:42 (-4), Bill Pragnell wrote:
> Jim Henderson <nos### [at] nospamcom> wrote:
>> On Tue, 27 Jan 2026 10:02:14 -0400, Cousin Ricky wrote:
>>> On 2026-01-26 02:00 (-4), Jim Henderson wrote:
>>>> But it looks like the file is tracked, so any changes to it made in one
>>>> branch shouldn't affect other branches,
> 
> Are we confusing our usage of 'change' perhaps? A 'change' to a file (in
> git-speak) refers to an edit, without any git interaction, which is what I've
> been assuming. A change to a branch is usually called a 'commit', and that will
> indeed be unique to the branch.
> 
>>> I'm sensing disagreement in what "tracked" means.  Jim is using
>>> "tracked" the way I've understood it, but Bill is describing the
>>> behavior I'm seeing from git.
> 
> I think git itself may also be confusing the issue here. 'Tracked' just means
> the file has been added to the repo. If I add a new file to a project (without
> git interaction - just make a new file within a repo), it is listed as
> 'untracked' because it does not yet have an entry in the repo - its entire
> contents are a 'change'. If I 'git add' and then 'git commit' that file, it is
> then 'tracked' as part of that branch from that point on. But you could say that
> even an 'untracked' file is tracked in the sense of git being aware of it,
> because it appears in the status. Only files/directories in .gitignore are truly
> untracked because edits to them will be ignored.
> 
> Uncommitted changes (i.e. edits to a file) will not be affected by switching
> branches, unless there is a conflict - i.e. if the edits apply to a section of a
> file that is different in the two branches. In that case, git will not switch
> branches, but instead tell you to commit or 'stash' your changes before
> switching (stashing is saving your changes on a temp stack rather than
> committing them).
> 
> Sorry if I'm muddying the water here! I remember being quite confused about how
> git worked when I first started using it.

No, this is very helpful!  Thank you!

(And I just watched a video about how pilots and air traffic controllers
unknowingly disagreed on definitions of terms, and the result was a
major crash, all souls lost.)


Post a reply to this message

From: Mr
Subject: Re: Nope, I STILL don't understand git branches
Date: 3 Feb 2026 04:45:00
Message: <web.6981c281461f9d4e16086ed06830a892@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2026-01-30 22:42 (-4), Bill Pragnell wrote:
> > Jim Henderson <nos### [at] nospamcom> wrote:
> >> On Tue, 27 Jan 2026 10:02:14 -0400, Cousin Ricky wrote:
> >>> On 2026-01-26 02:00 (-4), Jim Henderson wrote:
> >>>> But it looks like the file is tracked, so any changes to it made in one
> >>>> branch shouldn't affect other branches,
> >
> > Are we confusing our usage of 'change' perhaps? A 'change' to a file (in
> > git-speak) refers to an edit, without any git interaction, which is what I've
> > been assuming. A change to a branch is usually called a 'commit', and that will
> > indeed be unique to the branch.
> >
> >>> I'm sensing disagreement in what "tracked" means.  Jim is using
> >>> "tracked" the way I've understood it, but Bill is describing the
> >>> behavior I'm seeing from git.
> >
> > I think git itself may also be confusing the issue here. 'Tracked' just means
> > the file has been added to the repo. If I add a new file to a project (without
> > git interaction - just make a new file within a repo), it is listed as
> > 'untracked' because it does not yet have an entry in the repo - its entire
> > contents are a 'change'. If I 'git add' and then 'git commit' that file, it is
> > then 'tracked' as part of that branch from that point on. But you could say that
> > even an 'untracked' file is tracked in the sense of git being aware of it,
> > because it appears in the status. Only files/directories in .gitignore are truly
> > untracked because edits to them will be ignored.
> >
> > Uncommitted changes (i.e. edits to a file) will not be affected by switching
> > branches, unless there is a conflict - i.e. if the edits apply to a section of a
> > file that is different in the two branches. In that case, git will not switch
> > branches, but instead tell you to commit or 'stash' your changes before
> > switching (stashing is saving your changes on a temp stack rather than
> > committing them).
> >
> > Sorry if I'm muddying the water here! I remember being quite confused about how
> > git worked when I first started using it.
>
> No, this is very helpful!  Thank you!
>
> (And I just watched a video about how pilots and air traffic controllers
> unknowingly disagreed on definitions of terms, and the result was a
> major crash, all souls lost.)

Yes, that's good clear explanations, the topic itself is complex, and there is a
threshold to it, a kind of "Gestalt" that needs to be reached before one starts
to feel you gain more with all that complexity despite it's learning curve, and
after you reach it, you don't have to become expert/power-user to be okay. you
end up developing a cautious intuition of what features to stay away from vs the
ones to dive into until you do have more time :-D  I still consider myself very
much of a beginner, but still admire and enjoy this tool!


Post a reply to this message

From: Mr
Subject: Re: Nope, I STILL don't understand git branches
Date: 3 Feb 2026 05:00:00
Message: <web.6981c6a7461f9d4e16086ed06830a892@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:

> But .gitignore is one aspect of git that has never given me any surprises.

The way it had for me, if my poor memory is correct, was some kind of wildcard
that I wasn't aware I had used, and could apply ignore to a whole type of files
instead of specific ones. But you're probably more cautious than that. :-)


Post a reply to this message

From: Mr
Subject: Re: Nope, I STILL don't understand git branches
Date: 3 Feb 2026 05:10:00
Message: <web.6981c903461f9d4e16086ed06830a892@news.povray.org>
One other thing I notice when quickly going through this discussion, has been
left out of it, maybe because too "obvious" or people around here generally
better at it than I was (^-^), also you'd have had other issues if that was your
blind spot... but I remember it was one of the slightly confusing cornerstones
for me initially, so I do feel compelled to write about it:

....Just make sure you fully grasp the distinction and nature of Commit versus
push!


Post a reply to this message

From: Cousin Ricky
Subject: Re: Nope, I STILL don't understand git branches
Date: 3 Feb 2026 10:46:35
Message: <6982185b$1@news.povray.org>
On 2026-02-03 05:57 (-4), Mr wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
> 
>> But .gitignore is one aspect of git that has never given me any surprises.
> 
> The way it had for me, if my poor memory is correct, was some kind of wildcard
> that I wasn't aware I had used, and could apply ignore to a whole type of files
> instead of specific ones. But you're probably more cautious than that. :-)

Matter of fact, the wildcard feature has been a great organizational
tool for me.  My typical .gitignore entries include:
  *~
  /*/*
  /test_*

(The /*/* entry works for my Object Collection projects because Object
Collection contributions have no directory structure.)


Post a reply to this message

From: Jim Henderson
Subject: Re: Nope, I STILL don't understand git branches
Date: 3 Feb 2026 21:02:44
Message: <6982a8c4$1@news.povray.org>
On Tue,  3 Feb 2026 05:08:03 EST, Mr wrote:

> ....Just make sure you fully grasp the distinction and nature of Commit
> versus push!

100%.  I actually did my little test a few days ago without a remote even 
configured - because you can use git that way. :)



-- 
"I learned long ago, never to wrestle with a pig. You get dirty, and 
besides, the pig likes it." - George Bernard Shaw


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.