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

Update lisa docs #531

Closed
wants to merge 1 commit into from
Closed

Conversation

kdp1965
Copy link
Contributor

@kdp1965 kdp1965 commented Apr 27, 2024

I believe I fixed the inconsistent format between my local and the official data sheet builds.

@kdp1965 kdp1965 closed this Apr 27, 2024
@kdp1965
Copy link
Contributor Author

kdp1965 commented Apr 27, 2024

When I made a pull request, it said it had merge conflicts. Now sure I understand this ... is that supposed to happen?

@kdp1965 kdp1965 reopened this Apr 27, 2024
@urish
Copy link
Member

urish commented Apr 27, 2024

You may need to rebase your branch on top of the current main branch from tt06.

One way is to reset your repo state to match the current tt06 repo state:

Make sure you have a backup of your new docs version, and then:

git remote add upstream https://github.com/TinyTapeout/tinytapeout-06
git fetch upstream
git reset --hard upstream/main

then add + commit the new docs, and push again

Another way is just to create a new branch from the main branch of tt06, and put the files there

@kdp1965
Copy link
Contributor Author

kdp1965 commented Apr 27, 2024

Man, git is always so confusing. I did those three lines (actually it said remote upstream already exists), but the other two were successful. But then it told me:

Your branch and 'origin/update-lisa-docs' have diverged,
and have 3 and 2 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

So I did git pull and it said:

Your branch is ahead of 'origin/update-lisa-docs' by 2 commits.
  (use "git push" to publish your local commits)

Now I'm not sure if I should push the 2 commits that I had previously committed?

@urish
Copy link
Member

urish commented Apr 27, 2024

Man, git is always so confusing.

This may help: https://rebase-book.com/

After

git fetch upstream
git reset --hard upstream/main

and adding your changes / committing, you need to

git push --force-with-lease

to push them to your repo, ignoring any previous history

@kdp1965
Copy link
Contributor Author

kdp1965 commented Apr 27, 2024

Man, git is always so confusing.

This may help: https://rebase-book.com/

See, it's so confusing they have to write a whole book on just rebase! :)

Okay, I will try that and see if I can get a good Pull Request, even if I have to delete my existing fork and start over. I am on a branch on a fork, not sure if that makes any difference or not.

@kdp1965 kdp1965 closed this Apr 27, 2024
@urish
Copy link
Member

urish commented Apr 27, 2024

See, it's so confusing they have to write a whole book on just rebase! :)

I agree.

But once you get the idea (the gist - branches are just pointers to a commit, and the commits are organized as a tree, each commit pointing to one (or more) previous commits), it actually makes sense.

git fetch upstream - get a copy of the branches on the upstream repo (you can git remote -v to see which repo has the upstream alias). It only gets the commit and branch pointers, but doesn't update (yet) any of your branches.
git reset --hard upstream/main - moves your current branch to point to the same commit as main branch in the upstream repo (basically, updating a pointer).

Then git push --force-with-lease tells to set the main branch in the origin repo (that's your fork) to the same commit as your branch, ignoring the current value (force-with-lease just makes sure nobody else did a push before you overwrite the pointer, so no work is lost). It'll also push any commits that are missing in the remote repo (so that the new main in origin actually points into a valid branch).

I hope this helps!

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

Successfully merging this pull request may close these issues.

2 participants