User Tools

Site Tools


gitcommands

Useful git commands

Add Codeberg as a new remote:

git remote add codeberg https://codeberg.org/username/new-repo.git

Isolate the folder into a temporary branch:

git subtree split --prefix=your-subdirectory-name -b split-branch

Push that specific branch to Codeberg's main branch:

git push codeberg split-branch:main

Clone Repo and push to codeberg

git clone --no-hardlinks f:\dev\quasar f:\dev\quasar-<app-name>
cd \dev\quasar-<app-name>
python -m git_filter_repo --subdirectory-filter <app-name match case of dir in cloned repo> --force

# Remove any old references to Bitbucket that might have survived
git remote remove origin 2> nul

# Add the Codeberg remote
git remote add origin https://codeberg.org/YOUR_USERNAME/<app-name>.git

# Ensure your branch is named 'main' (Codeberg's default)
git branch -M main

# Push it up!
git push -u origin main --force

© Copyright - 2026 - Tim Evans

gitcommands.txt · Last modified: by tim45tenwa