POV-Ray : Newsgroups : povray.off-topic : Nope, I STILL don't understand git branches Server Time
27 Jan 2026 15:00:09 EST (-0500)
  Nope, I STILL don't understand git branches (Message 1 to 10 of 22)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Cousin Ricky
Subject: Nope, I STILL don't understand git branches
Date: 21 Jan 2026 23:15:27
Message: <6971a45f$1@news.povray.org>
I created a branch, made some changes there, then switched back to the
main branch, and the changes were also in that branch as well.  Why did
the changes apply to both branches?  What am I missing?

Most baffling is that I got branches to work just 3 weeks ago.  I don't
know what I did differently.


Post a reply to this message

From: Shay
Subject: Re: Nope, I STILL don't understand git branches
Date: 22 Jan 2026 21:40:00
Message: <web.6972df33461f9d4e75c22b329fe599e6@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> I created a branch, made some changes there, then switched back to the
> main branch, and the changes were also in that branch as well.  Why did
> the changes apply to both branches?  What am I missing?
>
> Most baffling is that I got branches to work just 3 weeks ago.  I don't
> know what I did differently.

90% chance you created a branch with `git branch` but then never checked it out.
Create a branch with `git checkout -b new-branch` to do both at the same time.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Nope, I STILL don't understand git branches
Date: 22 Jan 2026 23:25:25
Message: <6972f835$1@news.povray.org>
On 2026-01-22 22:38 (-4), Shay wrote:
> Cousin Ricky <ric### [at] yahoocom> wrote:
>> I created a branch, made some changes there, then switched back to the
>> main branch, and the changes were also in that branch as well.  Why did
>> the changes apply to both branches?  What am I missing?
>>
>> Most baffling is that I got branches to work just 3 weeks ago.  I don't
>> know what I did differently.
> 
> 90% chance you created a branch with `git branch` but then never checked it out.
> Create a branch with `git checkout -b new-branch` to do both at the same time.

Nope, that wasn't it.  It still changes both branches at the same time.


Post a reply to this message

From: Jim Henderson
Subject: Re: Nope, I STILL don't understand git branches
Date: 23 Jan 2026 09:46:12
Message: <697389b4$1@news.povray.org>
On Fri, 23 Jan 2026 00:25:24 -0400, Cousin Ricky wrote:

> On 2026-01-22 22:38 (-4), Shay wrote:
>> Cousin Ricky <ric### [at] yahoocom> wrote:
>>> I created a branch, made some changes there, then switched back to the
>>> main branch, and the changes were also in that branch as well.  Why
>>> did the changes apply to both branches?  What am I missing?
>>>
>>> Most baffling is that I got branches to work just 3 weeks ago.  I
>>> don't know what I did differently.
>> 
>> 90% chance you created a branch with `git branch` but then never
>> checked it out.
>> Create a branch with `git checkout -b new-branch` to do both at the
>> same time.
> 
> Nope, that wasn't it.  It still changes both branches at the same time.

I might be mistaken (it's WAY to early in the morning for me to be 
thinking about this), but if the file isn't added to the repo and just 
lives within the directory, then I don't think any changes get tracked, 
and this is the behavior you would probably see.

Make sure you use `git add <filename>` for anything you want change 
tracking enabled.



-- 
"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: Mr
Subject: Re: Nope, I STILL don't understand git branches
Date: 23 Jan 2026 19:20:00
Message: <web.69740f24461f9d4efe29df036830a892@news.povray.org>
Jim Henderson <nos### [at] nospamcom> wrote:
> On Fri, 23 Jan 2026 00:25:24 -0400, Cousin Ricky wrote:
>
> > On 2026-01-22 22:38 (-4), Shay wrote:
> >> Cousin Ricky <ric### [at] yahoocom> wrote:
> >>> I created a branch, made some changes there, then switched back to the
> >>> main branch, and the changes were also in that branch as well.  Why
> >>> did the changes apply to both branches?  What am I missing?
> >>>
> >>> Most baffling is that I got branches to work just 3 weeks ago.  I
> >>> don't know what I did differently.
> >>
> >> 90% chance you created a branch with `git branch` but then never
> >> checked it out.
> >> Create a branch with `git checkout -b new-branch` to do both at the
> >> same time.
> >
> > Nope, that wasn't it.  It still changes both branches at the same time.
>
> I might be mistaken (it's WAY to early in the morning for me to be
> thinking about this), but if the file isn't added to the repo and just
> lives within the directory, then I don't think any changes get tracked,
> and this is the behavior you would probably see.
>
> Make sure you use `git add <filename>` for anything you want change
> tracking enabled.
>
>
>
> --
> "I learned long ago, never to wrestle with a pig. You get dirty, and
> besides, the pig likes it." - George Bernard Shaw

Also I don't know how bad you feel about using GUI, but I love Git-Cola for
spotting that kind of issue.


Post a reply to this message

From: Bill Pragnell
Subject: Re: Nope, I STILL don't understand git branches
Date: 24 Jan 2026 12:30:00
Message: <web.6975009e461f9d4e95258fa76f35e431@news.povray.org>
Jim Henderson <nos### [at] nospamcom> wrote:
> On Fri, 23 Jan 2026 00:25:24 -0400, Cousin Ricky wrote:
> > Nope, that wasn't it.  It still changes both branches at the same time.
>
> I might be mistaken (it's WAY to early in the morning for me to be
> thinking about this), but if the file isn't added to the repo and just
> lives within the directory, then I don't think any changes get tracked,
> and this is the behavior you would probably see.
>
> Make sure you use `git add <filename>` for anything you want change
> tracking enabled.

Yes, this was my first thought - you need to commit your changes to the current
branch or nothing gets tracked. Use 'git add <...>' to stage the changes, 'git
commit' to commit them.

Bill


Post a reply to this message

From: Jim Henderson
Subject: Re: Nope, I STILL don't understand git branches
Date: 24 Jan 2026 16:10:21
Message: <6975353d$1@news.povray.org>
On Sat, 24 Jan 2026 12:25:51 EST, Bill Pragnell wrote:

> Yes, this was my first thought - you need to commit your changes to the
> current branch or nothing gets tracked. Use 'git add <...>' to stage the
> changes, 'git commit' to commit them.

IIRC, 'git status' will show if that's the case, as it shows untracked 
files.


-- 
"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: Bill Pragnell
Subject: Re: Nope, I STILL don't understand git branches
Date: 24 Jan 2026 17:40:00
Message: <web.69754a1a461f9d4e95258fa76f35e431@news.povray.org>
Jim Henderson <nos### [at] nospamcom> wrote:
> On Sat, 24 Jan 2026 12:25:51 EST, Bill Pragnell wrote:
>
> > Yes, this was my first thought - you need to commit your changes to the
> > current branch or nothing gets tracked. Use 'git add <...>' to stage the
> > changes, 'git commit' to commit them.
>
> IIRC, 'git status' will show if that's the case, as it shows untracked
> files.

Yep, 'git status' with no other args will list staged files, changed tracked
files and untracked files in separate sections.

This scenario sounds like there would just be items in the 'changes' section,
since these are changes to tracked files. A newly added file would appear in
untracked files.

Bill


Post a reply to this message

From: Cousin Ricky
Subject: Re: Nope, I STILL don't understand git branches
Date: 24 Jan 2026 20:13:06
Message: <69756e22$1@news.povray.org>
On 2026-01-23 10:46 (-4), Jim Henderson wrote:
> 
> I might be mistaken (it's WAY to early in the morning for me to be 
> thinking about this), but if the file isn't added to the repo and just 
> lives within the directory, then I don't think any changes get tracked, 
> and this is the behavior you would probably see.
> 
> Make sure you use `git add <filename>` for anything you want change 
> tracking enabled.

No, the files are definitely part of the repo.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Nope, I STILL don't understand git branches
Date: 24 Jan 2026 20:21:02
Message: <69756ffe$1@news.povray.org>
On 2026-01-23 20:15 (-4), Mr wrote:
> Jim Henderson <nos### [at] nospamcom> wrote:
>>
>> I might be mistaken (it's WAY to early in the morning for me to be
>> thinking about this), but if the file isn't added to the repo and just
>> lives within the directory, then I don't think any changes get tracked,
>> and this is the behavior you would probably see.
>>
>> Make sure you use `git add <filename>` for anything you want change
>> tracking enabled.
> 
> Also I don't know how bad you feel about using GUI, but I love Git-Cola for
> spotting that kind of issue.

Git-Cola has been wonderful, and it works seemlessly with the CLI.  But
the files in question *are* being tracked.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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