|
 |
Jim Henderson <nos### [at] nospam com> 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] yahoo com> 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
|
 |