Skip to main content


Git Upgrade of Friendica


!Friendica Support Hi, I want to upgrade my Friendica server.
I changed to `/var/www/friendica` and executed
`git config --global --add safe.directory /var/www/friendica`
then
`git pull`
`Updating f660c3894..2dbfb0700`
unfortunately, I got the:
`error: Your local changes to the following files would be overwritten by merge:
.codecov.yml
.editorconfig
.github/ISSUE_TEMPLATE/feature_request.md
.gitignore
...
Aborting`
My current version is Friendica 'Siberian Iris' 2022.03 - 1452.
What can I do?
Best, Robert
in reply to Robert Winkler

Is it possible that this error comes because of the "--add safe.directory.." command ? (I don't know what that is for.) Or did you change files manually in the directory?

Friendica Support reshared this.

in reply to Robert Winkler

/var/www/friendica# git pull
fatal: detected dubious ownership in repository at '/var/www/friendica'
To add an exception for this directory, call:

git config --global --add safe.directory /var/www/friendica

Friendica Support reshared this.

in reply to Roland Häder

@Roland Häder @Robert Winkler Thanks for the warning. I'm aware of the danger. Is there an alternative; or a recommended, save, proceedure? E.g., 'git pull' as a user, inspect, chown, etc.?

Friendica Support reshared this.

in reply to Robert Winkler

@Robert Winkler @Robert Winkler Yes, there is an alternative way. I don't know your server setup to well, so I can only tell you from mine. For each domain (e.g. haeder.net) I have a "virtual user", e.g. vuXXXX by XXXX is a 4-digit number. If I need shell access to it, I login as a normal user to my server, then run sudo su - vuXXXX to change into that user and then change to the sub domain's path. Then there I execute git pull and so on.

Friendica Support reshared this.

in reply to Robert Winkler

@Robert Winkler
it depends on why you have changes in tracked file? you need the changes?

no : ( would recommend this)

# this will reset your checkout at the current version in your HEAD,
# in your case I would say to commit f660c3894
git reset --hard HEAD 
git pull

yes: (but it can fail)
git stash #  this will save your changes in 'stash'
git pull
git stash pop  #  this will reapply your changes on top of new code. can fail

Friendica Support reshared this.

in reply to Robert Winkler

@Robert Winkler @Fabio I tried method 1 (no:), but now my instance is not funcional anymore:
"This page isn’t working mexico-pensante.blog is currently unable to handle this request.
HTTP ERROR 500"

the config looks fine (admin email, SQL).

from /var/mail/root:
"PHP Warning: require(/var/www/friendica/vendor/composer/../../boot.php): failed to open stream: No such file or directory in /var/www/friendica/vendor/composer/autoload_real.php on line 69
PHP Fatal error: require(): Failed opening required '/var/www/friendica/vendor/composer/../../boot.php' (include_path='.:/usr/share/php') in /var/www/friendica/vendor/composer/autoload_real.php on line 69
"

Any idea?

in reply to Robert Winkler

@Robert Winkler @Robert Winkler
from friendi.ca/2023/05/23/friendic… , "How To Update", "Using Git":
cd friendica
git pull
bin/composer.phar install --no-dev
cd addon
git pull

I think the first two command are done.
Now you have to update dependencies with composer, and update addons
in reply to Robert Winkler

@Robert Winkler @Fabio Thanks a lot! Looks better now; Still in maintenance mode, but I have hope now 😉.