how to rebase/squash

Hi. Rebasing really sucks. This is a guide to make it less sucky.

generating ssh keys

First, you need to generate an SSH key (this will open up in a new page). Click the link to do that, then check back here.

Now, go to the repo that you want to rebase at. You want to go to YOUR FORK. If you go to the main file (i.e. Zarel/Pokemon-Showdown instead of YOUR-FORK/Pokemon-Showdown), it will not direct you to the correct files. Navigate to the bar on the right. It will look like this:

Click on SSH, then click on the clipboard (or c/p it manually) and go to your terminal. The link will look like this:
git@github.com:Redew/Pokemon-Showdown.git

using the terminal

Next, type in everything after the $:

user@Computer-Name:~$ git clone REPOSITORY LINK

After you do that, navigate to it through cd. Example:

user@Computer-Name:~$ cd Pokemon-Showdown

Next, you tell it you want to rebase. Type in everything after the $:

user@Computer-Name:~/Pokemon-Showdown$ git rebase -i HEAD~NUMBER

The commits you want to rebase will be a number. Let's say you edited a file 3 times without it being merged. So, you would type in: git rebase -i HEAD~3. You will get something like this:

The order of commits from top to bottom goes oldest to newest, respectively.

Let's say we wanted to put the newest two commits into the top (oldest) commit. We can do this by navigating with the arrow buttons and replacing pick with squash:

After you've squashed what you want to, ctrl + x to exit. Press Y to save changes. When it asks you to rename, just click enter and continue with the default path. After that, type in:

user@Computer-Name:~/Pokemon-Showdown$ git push --force

You will get a weird spiel about git push, but at the bottom, you should see something like this:

Counting objects: 1, done.
Writing objects: 100% (1/1), 240 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To git@github.com:REPOLINK/PATH
+ d152d96...afa5b8e master -> master (forced update)

finish

Done! Everything should be squashed.