- Clone it:
git clone <url> <folder>
- Change origin url to my own fork:
git remote set-url origin <url>
- (Optional) Rename the branch
git branch -m <old> <new_branch_name>
- Push it to your repo
git push -u origin <new_branch_name>
- Initiate a rebase:
git rebase -i HEAD~4
- This selects the last four commits, but not all are necessarily included.
- The previous command opens up in Nano.
- Comment out the commits you don't want to squash.
- Change
pick
tos
in front of the commits you want to squash.
- Save.
- Push to remote.
- If you have already pushed one of these commits, you need to perform a force commit.
git push --force-with-lease