This approach uses the Upstream Sync GitHub Action to keep a
remote/origin
in sync with theremote/upstream
repo.
- Create and navgiate to, directory for repo:
mkdir <repo_name> && cd <repo_name>
- Initiate a new git repo:
git init
- Add upstream remote config:
git remote add --tags -t <branch> upstream [email protected]:<upstream_profile>/<upstream_repo>.git
- Add origin remote config:
git remote add origin [email protected]:<origin_profile>/<origin_repo>.git
- Fetch upstream tags:
git fetch --tags --prune upstream
- Pull upstream branch:
git pull upstream
- Push origin branch:
git push -u --tags origin <branch>
- Create Upstream Sync Action workflow file:
touch .github/workflows/sync.yml
- Copy/Paste
sync.yml
file contents, making required changes. - Commit changes:
git add -A && git commit -m "ci: add upstream sync action workflow"
- Push changes to origin repo:
git push origin <branch>