Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keeping a repository updated with template repo changes #67

Open
haani-niyaz opened this issue Jul 28, 2022 · 1 comment
Open

Keeping a repository updated with template repo changes #67

haani-niyaz opened this issue Jul 28, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@haani-niyaz
Copy link
Collaborator

It is expected that this template repo will undergo continuous improvement changes and teams should be able to keep their repos updated as this happens. There is however some confusion around how teams are expected to keep their repositories updated in the most seamless way.

It is also evident that there some are cases with undesirable effects:

When you create a new branch which includes the template repo git commits and it has template repo references with the issue number, Github will associate the commit to the matching project repo issues (if it exists with the same issue number).

Example:

Screen Shot 2022-07-28 at 8 03 34 pm

Acceptance Criteria

  • Provide easy instructions to raise a PR with the latest changes from the template repo
  • Ensure only changes from main branch or a tag is fetched if the template repo is added as another origin to the project repo
  • The PR branch pushed to Github should not include the template repo commit history (to resolve the issue described above)
@haani-niyaz haani-niyaz added the documentation Improvements or additions to documentation label Jul 28, 2022
@haani-niyaz
Copy link
Collaborator Author

haani-niyaz commented Jul 31, 2022

Tested instructions courtesy of @ldmi3i:

Run the following within your git repo:

  1. Add remote git remote add template https://github.com/rog-golang-buddies/golang-template-repository.git
  2. Fetch changes git fetch template main
  3. Create an "update" branch from your repo's main as git checkout -b update-from-template main
  4. Merge update to single commit git merge --squash template/main --allow-unrelated-histories
  5. Resolve conflicts
  6. Commit changes git commit -m 'chore(go-template): Updates from template'
  7. Push branch and create PR to main as usual

The --squash in step 4 is vital to circumvent the issues highlighted above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant