You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to updates and being able to get upstream changes, I know we went back-and-forth on whether this should be a template repo or not because it would disconnect people from upstream changes. I was recently introduced to the idea that your "remote" does not always have to be the exact same code repo when learning about copying a selection of commits/files from one repo into a different, existing and unrelated repo.
I learned in this blog post, that you can copy files from one repo to another AND retain a git history. I think we could use this by having a user setup this template repo as a remote to their pipeline and merge in changes that are made in the template. In our use-case here, we would not do the mkdir or git clone step of the "source" repo part. Instead, we would make a new branch in the existing pipeline repo and then follow along with the git clone just for the "target" repo. It should be able to handle merge conflicts since you are going to merge the branch from the source into your main from the target repo.
It might be fun to test this out and see if this helps us be able to `git pull new changes to the template into repos that have since deviated from the template. I imagine this would be an advanced user's action only, as it doesn't seem super straightforward.
The text was updated successfully, but these errors were encountered:
Instead, we would make a new branch in the existing pipeline repo and then follow along with the git clone just for the "target" repo.
Thanks for sharing, @lindsayplatt! I agree that this could be a useful pattern for advanced users. I'm not sure I'm following what steps are needed within this repo to test this out. Would we need to create a new branch in this repo, and if so, why can't a user set their upstream remote to main?
Sorry, I think I am not being super clear with the terminology I am using. Also, maybe the link above is not as helpful in this case but was the inspiration for me thinking we can connect a template repo with a repo that was created from the template.
I think the only changes needed to this repo, ds-pipelines-targets-example-wqp would be instructions in the README or elsewhere with how to setup this sort of workflow for pulling new changes from the template. Though, it would be necessary to test this process out and make sure it works as expected.
When you are setting this up in your own repo that was created from the template, let's call it my-pipeline, I think you would do the following inside of the my-pipeline repo:
Set up a remote called upstream-template in order to connect ds-pipelines-targets-example-wqp to my-pipeline (run git add upstream-template [email protected]:USGS-R/ds-pipelines-targets-example-wqp.git)
When there are new changes in the template that you want, pull changes from the upstream-template. I think you could do this by pulling directly into my-pipeline: main branch OR you could create a new branch in my-pipeline and then do a merge request later between the two branches of my-pipeline to track those changes in a PR but could be as easily included in a single commit. The simplest way to do this would be to run the following in my-pipeline: git pull upstream-template main.
Related to updates and being able to get upstream changes, I know we went back-and-forth on whether this should be a template repo or not because it would disconnect people from upstream changes. I was recently introduced to the idea that your "remote" does not always have to be the exact same code repo when learning about copying a selection of commits/files from one repo into a different, existing and unrelated repo.
I learned in this blog post, that you can copy files from one repo to another AND retain a git history. I think we could use this by having a user setup this template repo as a remote to their pipeline and merge in changes that are made in the template. In our use-case here, we would not do the
mkdir
orgit clone
step of the "source" repo part. Instead, we would make a new branch in the existing pipeline repo and then follow along with the git clone just for the "target" repo. It should be able to handle merge conflicts since you are going to merge the branch from the source into your main from the target repo.It might be fun to test this out and see if this helps us be able to `git pull new changes to the template into repos that have since deviated from the template. I imagine this would be an advanced user's action only, as it doesn't seem super straightforward.
The text was updated successfully, but these errors were encountered: