We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Changing server type to Git

  • #10970
    Avatar photo[anonymous]

    I was looking forward to that change. My blog is hosted on GitHub Pages, and pushing updates through the API generally took a couple of tries. After entering the repository URL, the access token, and everything else in the new Git server configuration, I click the “Test connection” button. The button changes to a “Checking connection,” and nothing else happens. Using the old GitHub Pages server settings, a “Success” popup appears almost instantly.

    Avatar photo[anonymous]


    How did you configured repository URL? It is

    Avatar photo[anonymous]

    Tomasz, yes it is. What scopes need to be set for the access token? I’ve given it full control over the repository.

    Avatar photo[anonymous]

    Same problem for me.

    As so far, I have not used Github, I started by following your tutorial on this page:

    Subsequently, I configured the GIT repository page as mentioned on this page:

    Click “Test connection”. Nothing happens. “Check connection” and that’s it.

    I’m surprised that I don’t need to enter the token anywhere. How is that supposed to work?

    Avatar photo[anonymous]

    Could you check if sync is working anyway after saving Git settings?

    Also please make sure that your token has full repository access. I had this issue only in one case – when I have created fine-grained token with too low permissions. For classic token it works correctly for me

    Avatar photo[anonymous]

    See screenshot.

    Shouldn’t I have to enter my token code somewhere in the Publii configuration?

    Avatar photo[anonymous]

    When I sync, Publii gives me no error message; however, nothing is actually uploaded.

    Avatar photo[anonymous]

    Well – I know what you probably did – you have entered your Github password instead of the token 🙂 And probably you have enabled 2FA so it won’t work – you must use the token instead 🙂

    Avatar photo[anonymous]

    @Patrick Strahm – are you using password or token in the Git configuration under “Password field”?

    Avatar photo[anonymous]

    Hi Tomasz, I’m using the token since I have 2FA enabled. I can give it a try to save and sync this evening to see if that works.

    Avatar photo[anonymous]

    Hi Tomas,

    You were correct about the password, but entering the token ilo my password doesn’t change anything to the situation.

    2FA is not enabled.

    Not sure if this is an issue, but when I go to another website in Publii, return to my Github website in Publii, click “Show Password”, it’s doesn’t show my token anymore, but the text “publii-git-password olb-sjb-malle”. Maybe this is a way of protecting the password?


    Avatar photo[anonymous]


    I also just moved from using the GitHub API to the new Git configuration, and when using the ‘Test Connection’, it gets stuck. Saving the settings and trying to sync however works, showing that the configuration works.

    What however I am experiencing is that for some reason it override the GitHub Pages configuration disconnecting it from the custom URL. I repeated it a few times, same thing.

    It’s worth mentioning that I did no changes on the website, just re-synced to verify the connection, and I am not sure why it’s deleting the custom URL in the GitHub Pages settings.

    Anyone has any idea about it?


    Avatar photo[anonymous]

    I noticed the same as Mathias. When I save my access token in the password field, save the settings, exit the server settings, go back, and click “Show password” the token is gone. Instead, the password field shows “publii-git-password name-of-my-blog”.

    I also tried to sync my website, but the process stopped after compressing the site.

    Avatar photo[anonymous]

    Same as Mathias.

    If I try to sync with the password it gives an authentication error and can’t test the connection (it remains as testing indefinitely)

    If I put the token, also I can’t test and when I try to sync, it displays “website synced” when in reality it didn’t commit nothing.

    Also as Maathias stated, when I put the token or password refresh the server page, it changes the password input to “publii-git-password….”

    Avatar photo[anonymous]

    Hi again,

    I have made few fixes:

    1) In fact – after coming back to server settings the password is not displayed – it is a simple bug, but it won’t affect sync process

    2) You get infinite testing due lack of error message output if the connection code fails. But in most cases it means that your authentication data are invalid or token permissions are too low – it will be fixed too and Publii will display an alert for such case

    3) I have also added few additional message – under website URL notice about CNAME files (which should be placed in Tools -> File Manager -> root files) and also label “Password” has been changed to “Password / Token” – the notice about 2FA has been also added as a note under this field

    This release (v.0.44.1) with fixes will be published on Wednesday

    Regarding permissions on Github:

    1) If you are using classic tokens, you must allow use of the repo permissions
    2) For the fine-grained tokens you must add at least read-write access for the “Contents”

    In other cases I got error 403 Forbidden while trying to test connection

    Avatar photo[anonymous]

    I’ve successfully switched from the GitHub connector to Git and pushing into GitHub pages using a classic personal access token. I did get tripped up on the CNAME but found a previous forum post on creating the CNAME file and adding to root files. It will be good to see the additional message about the CNAME file and adding “token” to the password field.

    I would recommend not displaying a full token if revealing the text in the password field. PATs bypass 2FA and GitHub doesn’t allow you to see the PAT after it is created – I don’t think Publii should make it that easy either.

    Avatar photoBob

    FYI: the new Publii hotfix release v.0.44.1 is available to download:

    Avatar photo[anonymous]

    Awesome! I’ll test it tonight.

    Avatar photo[anonymous]

    Bummer 🙁. The “Test connection” still fails, and synchronization doesn’t go further than “Compressing objects.”

    Avatar photo[anonymous]

    @Patrick Strahm – did you changed the password/token field and resaved the sync settings after updating the app?

    Avatar photo[anonymous]

    Tomasz, yes I did. I also quit and relaunched the app. I have two entries in Keychain Access (publii-gh-token and publii-git-password), both with the correct access token. After restarting the app and trying to sync, I had to grant Publii Keychain access.

    Avatar photo[anonymous]

    Do you have anything under Tools -> Log viewer -> deployment-process/deployment-errors?

    Avatar photo[anonymous]

    The deployment-errors log has the following:

    (node:89716) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

    Please migrate your code to use AWS SDK for JavaScript (v3).
    For more information, check the migration guide at
    (Use `Publii Helper –trace-warnings …` to show where the warning was created)

    Avatar photo[anonymous]

    It seems to be old log, because it is not the case on Publii v.0.44 – and what about deployment-process.log?

    Avatar photo[anonymous]

    A couple of CREATE BLOB entries followed by:

    [Thu, 16 Nov 2023 16:40:32 GMT] (i) TRIED AGAIN: (api) => api.gitdata.createTree – undefined

    I did get such an error message once right after reverting to 0.43.1 from 0.44.0. So this may not be recent.

    Avatar photo[anonymous]


    I discovered in the log file that the upload was not even trying to upload my site because it thought there were no changes:

    changes exists = false

    So, I intentionally changed something on a page and redeployed. This triggered an error message that my be interesting to look into:

    Git debug: commit done
    [Mon, 20 Nov 2023 11:00:42 GMT] ERROR: PushRejectedError: Push rejected because it was not a simple fast-forward. Use “force: true” to override.

    Avatar photo[anonymous]

    @Mathias – please try to remove “output” catalog and create an empty one. BTW – did you changed something on your repository manually?

    Avatar photo[anonymous]

    Dear Tomasz,

    Yes! Deleting the “output” directory solved the problem! I can now upload my files and publish my website on GitHub!


    Avatar photo[anonymous]

    Still no luck whatsoever with 0.44.1. When using Git, it does not move beyond “Compressing objects.” When I switch the server type in 0.44.1 to use the GitHub Pages API, I get a 422 status error. I am currently stuck using 0.43.1.

    Avatar photo[anonymous]

    Access Token Scope:

    Check if your access token has the necessary scopes. It should have at least “repo” scope for private repositories and “public_repo” for public repositories.
    Repository URL:

    Double-check the repository URL to make sure it is accurate and follows the correct format. It should be in the format:
    Firewall or Network Issues:

    Ensure that there are no firewall or network issues preventing the connection. If you are behind a corporate firewall, check if it is blocking the connection.

    Avatar photo[anonymous]

    One thing I noticed with the output folder. When syncing, the old 0.43.1 wipes and recreates the contents of the folder almost instantly. Nothing happens in 0.44.1. And if I delete it myself, it stays empty.

    Avatar photo[anonymous]

    @Patrick Strahm – could you check the contents of the Tools -> Log Viewer -> deployment-process/deployment-errors log files?

    Avatar photo[anonymous]

    Self-Hosted Git Server:

      <li style=”list-style-type: none;”>
    • If you prefer to host your Git repositories on your own server, you can set up a self-hosted Git server. Git itself does not provide server functionality; you’ll need to use software like Gitolite, Gitea, or GitLab Community Edition for self-hosting.
    • Gitolite: Simple and lightweight Git server.
    • Gitea: A community-managed lightweight code hosting solution.
    • GitLab Community Edition: A more feature-rich Git repository manager.
    Avatar photo[anonymous]

    @Tomasz Dziuda – the deployment-errors.log is empty. The deployment-process.log only shows CREATE BLOB entries for the page I changed, feed.json, feed.xml, sitemap.xml, and TRIED AGAIN: (api) => api.gitdata.createTree – undefined. That’s from a sync using the GitHub Pages API.

    I changed a page, switched the server type to Git, and tried to sync. I let Publii stay at “Compressing objects” for some time, and when I canceled, the attached error message popped up.