Merging Shenanigans
Fork
- https://docs.github.com/en/get-started/quickstart/fork-a-repo
- https://cli.github.com/manual/gh_repo_fork
Add original repo as upstream
git remote add upstream https://github.com/turboderp/exllama.git
Get the latest:
# Make sure we're up to date and on master
git checkout master
# Remote
git fetch upstream
git rebase upstream/master
Conflicting Files
First if you have unstaged changes:
git restore --staged test_benchmark_inference.py
Then use theirs
git checkout --theirs test_benchmark_inference.py
If this doesn’t get you up to speed the latest as it should, you can merge like so:
git checkout upstream/master -- test_benchmark_inference.py
You can then press forward
git rebase --continue
Not you can also skip a local commit if you want
git rebase --skip
Lastly, once everything is hunky dory on your local repo you can
git push --force
to replace your origin master now that it’s synced properly with upstrea master again
Squashing commits
This is useful for PRs, here’s a tutorial: https://www.internalpointers.com/post/squash-commits-into-one-git
Basically you just want to do an interactive rebase on the commits you want to squash
# last 2 commits
git rebase -i HEAD~2
Then change the “pick/p” for the commit you want to use, and “squash/s” for the ones you