Recent

Author Topic: Is it possible to do git pull?  (Read 1056 times)

cdbc

  • Hero Member
  • *****
  • Posts: 1771
    • http://www.cdbc.dk
Is it possible to do git pull?
« on: December 09, 2024, 11:45:55 pm »
Hi
As the title says, is it possible to do a 'git pull origin main' when I'm standing in my 'Lazarus' directory, created by 'FpcUpDeluxe' during install?!?
Thus getting the newest sources for lazarus, without having to do a new install with fpcupdeluxe. I mean, git pull -> apply my own patches and the just recompile lazarus... Wouldn't that be nice  :D
'git status' shows me the four patches, because I haven't committed them...
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

Fred vS

  • Hero Member
  • *****
  • Posts: 3459
    • StrumPract is the musicians best friend
Re: Is it possible to do git pull?
« Reply #1 on: December 10, 2024, 12:09:48 am »
Hello.

This works here:
For Lazarus:
Code: Pascal  [Select][+][-]
  1. $ cd /home/fred/fpcupdeluxe/lazarus/
  2. $ git pull --all
  3. > Fetching origin
  4.    Already up to date.
For fpc:
Code: Pascal  [Select][+][-]
  1. $ cd /home/fred/fpcupdeluxe/fpcsrc/
  2. $ git pull --all
  3. >Fetching origin
  4. remote: Enumerating objects: 7253, done.
  5. remote: Counting objects: 100% (2378/2378), done.
  6. remote: Compressing objects: 100% (268/268), done.
  7. remote: Total 7253 (delta 2175), reused 2220 (delta 2107), pack-reused 4875 (from 1)
  8. Receiving objects: 100% (7253/7253), 7.35 MiB | 2.89 MiB/s, done.
  9. Resolving deltas: 100% (4801/4801), completed with 394 local objects.
  10. From https://gitlab.com/freepascal.org/fpc/source
  11.    22da36f83e..57e84ef714  fixes_3_2            -> origin/fixes_3_2
  12.    159d97e864..f429dab7b3  main                 -> origin/main
  13.    ba34a5fe2c..cd84c2d5cd  release_3_2_4-branch -> origin/release_3_2_4-branch
  14.  * [new branch]            rtti-thunk-no-global-label -> origin/rtti-thunk-no-global-label
  15. Updating 22da36f83e..57e84ef714
  16.  

I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

TRon

  • Hero Member
  • *****
  • Posts: 3787
Re: Is it possible to do git pull?
« Reply #2 on: December 10, 2024, 12:41:39 am »
.. without having to do a new install with fpcupdeluxe.
Dumb question perhaps but why is there FPCUpDeluxe in that equation ? How would you test your patches otherwise ? Pull, apply, build... and if you so must then install. No FPCUpdeluxe required.
I do not have to remember anything anymore thanks to total-recall.

Warfley

  • Hero Member
  • *****
  • Posts: 1850
Re: Is it possible to do git pull?
« Reply #3 on: December 12, 2024, 12:38:51 am »
You can easily update any lazarus installation using git. Even lazarus installations you installed, e.g. through an installer (also on windows)

If your lazarus directory is not yet a git directory, first initialize git (skip if it's already a git repository):
Code: Bash  [Select][+][-]
  1. git init
  2. git remote add origin https://gitlab.com/freepascal.org/lazarus/lazarus.git
Now you can fetch the all the new branches and versions:
Code: Bash  [Select][+][-]
  1. git fetch --all
If you want to change from a stable version to another stable version, you can switch the branch. E.g. if you want to update form the current version (e.g. 3.6) to 4.0rc1:
Code: Bash  [Select][+][-]
  1. git reset --hard tags/lazarus_4_0_RC_1
  2. git checkout tags/lazarus_4_0_RC_1
If instead you are already on main/trunk but just want to update to the newest commit just do:
Code: Bash  [Select][+][-]
  1. git reset --hard origin/main
Note, the reset resets all changes, if you want to save them do a stash before
Code: Bash  [Select][+][-]
  1. git stash
  2. # reset and/or checkout
  3. git stash pop

Now your directory is on the desired version you can rebuild:
Code: Bash  [Select][+][-]
  1. make clean
  2. make lazbuild PP=$(realpath ../fpc/bin/fpc) # change to fpc.sh for fpcup installation
  3. ./lazbuild --build-ide=
Note that you must choose the correct path for the make lazbuild. If you use the system fpc you don't need to add any PP=..., if you have a custom fpc installation choose that one. FPCUp usually installs fpc as fpc.sh into the parent folders fpc/bin

This is actually how I update pretty much all of my lazarus installations, including on windows where I installed them with the windows installer.
« Last Edit: December 12, 2024, 05:19:30 pm by Warfley »

 

TinyPortal © 2005-2018