treehouses / treehouses.github.io

A Markdown Wiki for treehouses 🏡
http://treehouses.io
132 stars 107 forks source link

Add steps for if you fail to sync your fork #823

Open JLKwong opened 3 years ago

JLKwong commented 3 years ago

Problem

In Step 6, GitHub Issues, the steps to sync your fork do not work in all cases.

Steps to reproduce the problem

Although I encountered this, I don't know what I did to produce this problem. My master branch was ahead of treehouses's branch for some reason, and syncing my fork would not make it even.

Screenshots

image

Proposed solution

Add optional steps after the original steps to sync your fork:

If you encounter any issues with syncing your fork:

  1. Read the Technical Questions in our FAQ for your issue.
  2. If you still cannot resolve the issue, please go to the treehouses Gitter chat and @/all explaining your issue.

Add the following to the Technical Questions section in the FAQ page:

If your master branch is ahead by x commits on your GitHub repository, try the following steps to resolve your issue:

  1. Go to your master branch using git checkout master.
  2. Undo local changes using git reset.
  3. Push using git push --force.
  4. If your master branch is still ahead, force the undo using git reset --hard upstream/master, then push again using git push --force.
rjpadilla commented 3 years ago

In order to find out why you're ahead on a certain branch, type git log. From there you can deduce what commit is responsible for your uneven branch.

I think your solution is great for uneven branches but I feel like it should belong somewhere on the FAQ page in the Technical Questions section. The reason being that unless you've just fetched, your master branch should never be ahead. We're not sure why your branch was ahead, but it doesn't make sense to add a solution for an unclear problem.

JLKwong commented 3 years ago

In order to find out why you're ahead on a certain branch, type git log. From there you can deduce what commit is responsible for your uneven branch.

@rjpadilla This is a wonderful solution. ✨ I'll revise my issue to use git log instead of git reset.

I think your solution is great for uneven branches but I feel like it should belong somewhere on the FAQ page in the Technical Questions section.

I'll add the git reset option to the Technical Questions section, and add a link to the FAQ as one of the steps in case anyone encounters an issue.