Skip to content

Update Repos - Upstream

We have a few repos that have our own patches to make them work with our systems (as well as keep control of tehm, to a degree).
Occasionally we have to update them

The general procedure is to pull them down locally, fetch the upstream and rebase, then force push up to our own repo.

Nixos Mailserver

About: This is what our mailserver runs on, it packages up several different programs and provides us a consistent interface.
Repo: https://forgejo.skynet.ie/Skynet/misc_nixos-mailserver
Upstream: https://gitlab.com/simple-nixos-mailserver/nixos-mailserver

Repos Impacted

Procedure

Assuming you are in an empty folder

git init

# if ye have ssh enabled
git remote add origin ssh://forgejo@forgejo.skynet.ie:9001/Skynet/misc_nixos-mailserver.git
# if ye dont have ssh enabled
git remote add origin https://forgejo.skynet.ie/Skynet/misc_nixos-mailserver.git

# add the upstream one 
git remote add upstream https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git

# we need to pull down our own and fetch teh upstream
git pull origin main
git fetch upstream main

# this puts our changes on top of the upstream changes
# there might be merge conflicts ye have to sort out
git rebase upstream/main

# push it up
git push origin main --force

# and ye can then bump any repo that uses this

Forgejo Releases

About: This is a foregejo action to upload artifacts to the releases tab of Forgejo
Repo: https://forgejo.skynet.ie/Skynet/actions-forgejo-release
Upstream: https://code.forgejo.org/actions/forgejo-release

Repos Impacted

Procedure

Assuming you are in an empty folder

git init

# if ye have ssh enabled
git remote add origin ssh://forgejo@forgejo.skynet.ie:9001/Skynet/actions-forgejo-release.git
# if ye dont have ssh enabled
git remote add origin https://forgejo.skynet.ie/Skynet/actions-forgejo-release.git

# add the upstream one 
git remote add upstream https://code.forgejo.org/actions/forgejo-release.git

# we need to pull down our own and fetch teh upstream
git pull origin main
git fetch upstream main

# this puts our changes on top of the upstream changes
# there might be merge conflicts ye have to sort out
git rebase upstream/main

# because this is an action you will need to re-tag it.
# it is best to use the next number tag upfor our use case since the actual actions get cached on teh runners, identified by the tags
# v2 might not be the next one
git tag -f -m "" v2

# push it up
git push origin main --force --tags

# and ye can then bump any repo that uses this