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

updating existing experiments #59

Closed
JuneOh710 opened this issue Apr 2, 2022 · 1 comment
Closed

updating existing experiments #59

JuneOh710 opened this issue Apr 2, 2022 · 1 comment

Comments

@JuneOh710
Copy link
Contributor

I made some changes to the existing experiments and I'm wondering if I would need to make another pull request. If so, could you provide me wit some instructions? I remember not doing the pull request correctly and I would like to get them right this time.

@vsoch
Copy link
Member

vsoch commented Apr 2, 2022

Sure! So if there are changes in the experiment repos themselves, you shouldn't need to update here - this is a registry / library of experiments and as long as it's at the same preview address it should work.

If you do need to still make a PR to update metadata, let's talk about that. First let me attempt to explain what I think is happening. I suspect the issue you are running into is that you pushed commits to your fork of expfactory/experiments master branch, and thus whenever you check out a new branch it comes with all of the old history (that was squashed and merged). So imagine we have these three commits:

commit A
commit B
commit C

And they are squashed and merged into commit D. This final one is what the expfactory/experiments master branch sees here. So then imagine that you checkout a new branch from your current main with commits A,B,C, all of a sudden when you open a PR here, the expfactory/experiments master branch does not know those commits. So they show up as "new." And imagine doing that multiple times over, you get 10s or more of old commits.

okay! So here is what I would do.

  • delete your fork entirely of the repo, e.g., https://github.com/JuneOh710/experiments.
  • delete your local clone of it too. Of course make sure to save the actual files for anything you've been working on - you can copy paste them into a new branch of your updated repo.
  • Re-fork the repository to your account
  • Clone the new fork to start fresh

At this point, your fork will be perfectly inline with expfactory/experiments. From this point on, you are never to update the master branch of your fork unless the commit has come from upstream. You basically want to keep your fork's master in line with the upstream master here. You can do this by first adding the remote named "upstream" (just do this one)

$ git remote add upstream https://github.com/expfactory/experiments

And then you can update your master to the master here like:

$ git checkout master
$ git pull upstream master
$ git push origin master

Okay, so the state we are at now has our master branch in sync with the one here! Those are the only operations you should ever do on your master branch. Never commit to it directly. Now let's checkout a new feature branch from that:

$ git checkout -b update/experiment-name

That branch will be derived from master, and at this point you can copy files from your old fork that you wanted to save, or just make changes as you would, commit and push. Since the commit history is in line with the upstream master, we won't see any extra (missing) commits.

Let me know if you have any questions!

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

No branches or pull requests

2 participants