Jim Henderson <nos### [at] nospamcom> wrote:
> On Thu, 07 Oct 2021 08:40:08 -0400, Cousin Ricky wrote:
> > On 2021-10-06 10:55 PM(-4), Cousin Ricky wrote:
> >> On 2021-10-06 12:09 PM (-4), Jim Henderson wrote:
> >>> On Tue, 05 Oct 2021 23:18:53 -0400, Cousin Ricky wrote:
> >>>> Damn. I added a license and readme to GitHub, tried to pull the
> >>>> changes to my local repo, and it's still giving me exit status 128.
> >>>> Do I have to do this rebase thing every time I make a change? Why
> >>>> does every simple thing have to be so freaking complicated?
> >>> A rebase shouldn't be needed every time - how did you add the license/
> >>> readme to github?
> >> When you create an empty repo on GitHub, it encourages you to create a
> >> readme and a license as part of the creation process.
> >> For the rest of my modules, I sidestepped the problem by creating the
> >> readme and license files in my local directories, and uploading them as
> >> part of the initial push.
> > Ignore that last answer; it's not just that all this wrestling with Git
> > has caused me to lose track of days, it has caused me to lose track of
> > my state of confusion. Actually, after I pushed the project to GitHub,
> > I used the buttons dedicated to adding the readme and the license.
> Once done, you probably just needed to do a pull before making additional
> changes in your local copy. But since those would be the only files that
> changed upstream, a rebase (or the stash option I mentioned earlier)
> should resolve it.
> The only time a rebase should be necessary is if there are changes both
> remote and local that need to be reconciled, IIRC.
> "I learned long ago, never to wrestle with a pig. You get dirty, and
> besides, the pig likes it." - George Bernard Shaw
Please the experts correct me if I'm wrong, but here is the beliefs that have
kept me relatively out trouble for a while:
Almost number one thing to understand, maybe someone already explained: but
Remember that commit and push are two different actions (picture attached) and
that you have to do both every time you "finalize" some changes so that your
local(commit) and remote(push) repositories stay in synch.
Git is specific because it is decentralized (every developer works on a local
duplicate copy of the whole project tree) and its workflow can be pictured as a
raft boat floating on the water of that remote whole project, because you can
keep your local changes floating over the changes made by other people while you
were working, by doing a pull --rebase (think of your changes as being held
aside, the other dev's update done
and then your updates layered over as if they had been made after.)
So, it is best practice to *always* do that pull --rebase (avoiding many
blocking "repo not clean" error) at least before pushing your changes and also
additionally anytime you suspect some remote changes may impact your current
work to correct it accordingly and avoid drafty history.
Post a reply to this message