POV-Ray : Newsgroups : povray.off-topic : Still stumped by git branches Server Time
14 Jan 2026 08:27:48 EST (-0500)
  Still stumped by git branches (Message 1 to 4 of 4)  
From: Cousin Ricky
Subject: Still stumped by git branches
Date: 1 Jan 2026 11:00:35
Message: <69569a23$1@news.povray.org>
I'm trying to learn branches in git, and one bit of advice I've heard,
from the one video that's been most helpful to me, is that "merging
locally isn't normally done; instead, changes are pushed and a pull
request is made."  So I did that, and now my GitHub repo is up-to-date.
GitHub also assured me that I could delete the branch, so I did that.

But now, I've still got 2 local branches, and my local main[*] does not
have the changes from the branch.  How do I update the local main if I'm
not supposed to merge locally?

I have both branches backed up locally, because frankly I don't know
what I'm doing, and I've corrupted repos before and had to git init or
git clone from scratch.  It's a hassle maintaining both git and manual
systems in parallel, but at least I know I won't lose everything on my
next git stumble.

I've been using git for 4 years now, in part on the promise that it will
make my life easier.  How can that happen when, after 4 years, this
software is still utter black magic to me?

[*]"master" using the old terminology.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Still stumped by git branches
Date: 1 Jan 2026 12:44:14
Message: <6956b26e@news.povray.org>
On 2026-01-01 12:00 (-4), Cousin Ricky wrote:
> 
> But now, I've still got 2 local branches, and my local main does not
> have the changes from the branch.  How do I update the local main if I'm
> not supposed to merge locally?

I think I figured it out.  You're suppose to do a pull from GitHub after
you've done the pull request from the branch, right?

git checkout main
git pull origin main


Post a reply to this message

From: Bill Pragnell
Subject: Re: Still stumped by git branches
Date: 2 Jan 2026 07:15:00
Message: <web.6957b6383779175995258fa76f35e431@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2026-01-01 12:00 (-4), Cousin Ricky wrote:
> >
> > But now, I've still got 2 local branches, and my local main does not
> > have the changes from the branch.  How do I update the local main if I'm
> > not supposed to merge locally?
>
> I think I figured it out.  You're suppose to do a pull from GitHub after
> you've done the pull request from the branch, right?
>
> git checkout main
> git pull origin main

Yes, once the remote branch is merged into main, you pull main so you have the
changes locally. You can then branch from that going forwards. You can
(optionally) delete the local branch too at that point - any further changes are
best done via a new branch and PR.

I use git for work daily; I'm no wizard but I have a somewhat intuitive feel for
my usual workflow now. I rarely get tangled up any more, and there's endless
examples and tutorials to be googled for help if I do. I remember when I first
started using it, there really was the feeling that I was just reciting
incantations with no obvious connection to reality :)

Bill


Post a reply to this message

From: Shay
Subject: Re: Still stumped by git branches
Date: 13 Jan 2026 17:30:00
Message: <web.6966c75b37791759d57db8d19fe599e6@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> I'm trying to learn branches in git, and one bit of advice I've heard,
> from the one video that's been most helpful to me, is that "merging
> locally isn't normally done; instead, changes are pushed and a pull
> request is made."  So I did that, and now my GitHub repo is up-to-date.
> GitHub also assured me that I could delete the branch, so I did that.
>
> But now, I've still got 2 local branches, and my local main[*] does not
> have the changes from the branch.  How do I update the local main if I'm
> not supposed to merge locally?
>
> I have both branches backed up locally, because frankly I don't know
> what I'm doing, and I've corrupted repos before and had to git init or
> git clone from scratch.  It's a hassle maintaining both git and manual
> systems in parallel, but at least I know I won't lose everything on my
> next git stumble.
>
> I've been using git for 4 years now, in part on the promise that it will
> make my life easier.  How can that happen when, after 4 years, this
> software is still utter black magic to me?
>
> [*]"master" using the old terminology.

If you aren't merging into a shared branch (i.e., if you're the only one working
on a project and you aren't updating two branches at once), I wouldn't give it a
second thought. The main idea is to avoid merge commits (which you can easily
end up with anyway if you accept a pr), but you won't have merge commits as a
single user if you

- git checkout some-branch (or) git checkout -b some-new-branch
- make come commits, decide you want to keep them
- git checkout main
- git merge some-branch

The only thing branching is giving you here is a "save point" in case you want
to discard an entire feature. Git, like many things, is as hard as you want to
make it.
-


Post a reply to this message

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