Lazarus

Free Pascal => General => Topic started by: SymbolicFrank on September 27, 2022, 03:51:31 pm

Title: Update FPC fork
Post by: SymbolicFrank on September 27, 2022, 03:51:31 pm
I have an FPC fork on GitLab to create pull requests. How do I update that to the current FPC version? It isn't a paid account, so mirroring doesn't work.
Title: Re: Update FPC fork
Post by: Thaddy on September 27, 2022, 03:55:41 pm
No not fork. No help required.
Do you have a good reason for it? Better be a good one...
Title: Re: Update FPC fork
Post by: SymbolicFrank on September 27, 2022, 04:03:18 pm
Well, I made it to make a pull request to fix my bug reports about a few problems with DBF files. Now it seems that I have to extend the TMSSQLConnection.

I hope I don't have to make a new fork and configure the build environment again, it was a lot of work. I just want to update it (pull) to a copy of the current FPC repository.
Title: Re: Update FPC fork
Post by: Martin_fr on September 27, 2022, 04:10:00 pm
I have an FPC fork on GitLab to create pull requests. How do I update that to the current FPC version? It isn't a paid account, so mirroring doesn't work.

And you have a clone of that fork on your local PC?

Add the original FPC gitlab url as a 2nd remote to your local clone.
Code: Text  [Select][+][-]
  1. git remote add fpc http://......
(or use your git gui...)

Then you can pull or "git remote update" from each remote.

You can then push to your fork.
For this you should have a local branch that "tracks" origin/main (assuming your fork remote is called "origin" / as is default / "git remote -v")
The easiest is probably if that branch is NOT your work branch.
That is if you committed your changes to "main" (local branch main) then you may use another name.

Code: Text  [Select][+][-]
  1. git switch -c fork-main --track  origin/main
  2. git merge --ff-only fpc/main
  3. git push
  4.  

If the merge doesn't work: git stash push ; git switch -f -C fork-main fpc/main ; git stash pop
Note, this form of git switch will not ask questions, it clears changes in your work tree, and move the branch, which in other scenarios can mean commits that are only on that branch are "kinda dropped".
Title: Re: Update FPC fork
Post by: SymbolicFrank on September 27, 2022, 04:17:19 pm
Ah, in that way. Thanks, I'm going to try try that (very carefully ;) ).

Yes, the GitLab fork is for publishing the pull request, I have cloned it locally.
Title: Re: Update FPC fork
Post by: Martin_fr on September 27, 2022, 04:30:57 pm
Ah, in that way. Thanks, I'm going to try try that (very carefully ;) ).

Yes, the GitLab fork is for publishing the pull request, I have cloned it locally.

So long as you don't use -f or uppercase -C on git switch, it is all save.

Uncommitted changes need to be stashed.

Anything that is committed is save (as long you do not do: rm -rf .git). git keeps all commits for at least 2 weeks (by default) before it really gets rid of them (e.g. if you delete a local branch).
And in many cases even longer. (something called a reflog) - not going into detail now, until anyone needs it.
Title: Re: Update FPC fork
Post by: Arioch on September 27, 2022, 04:43:53 pm
Refer to the manuals for git program you have.

Personally i use TortoiseGit on Window and almost enver use the command line

But there are many other git clients, textual and graphic, so see which one is most comfortable to you, and then read sppecific instructions to it.

Branching and merging are at the core of git process, and are described many places.
If you are new to the very concept - i would suggets you to start with general (git-agonstic) https://en.wikipedia.org/wiki/Version_Control_by_Example

Then after you learn branching and merging, i suggest you learn about cherry-picking specific commits form other branches. Sometimes it is helpful, albeit can also be more problematic, than full-branch merge. Again, learn it in general concepts in Git Book, and after that in specific buttons and windows in user manual for your git program,
Title: Re: Update FPC fork
Post by: PascalDragon on September 28, 2022, 09:33:38 am
No not fork. No help required.
Do you have a good reason for it? Better be a good one...

Forks are normal when operating with Git repositories as they're required for merge requests ::)
TinyPortal © 2005-2018