Skip to content

Instantly share code, notes, and snippets.

@JohnRTitor
Last active July 3, 2024 09:56
Show Gist options
  • Save JohnRTitor/af1777f2efe57da36a2c15ab7624ab60 to your computer and use it in GitHub Desktop.
Save JohnRTitor/af1777f2efe57da36a2c15ab7624ab60 to your computer and use it in GitHub Desktop.
Force push and interactive rebasing and amend

Interactive rebase (for squash, edit/amend, reword/rename, drop/remove):

git rebase --interactive HEAD~2

After a rebase like this, always force push

git fetch upstream
git rebase upstream/master
git push --force-with-lease

Clone only the last commit and a specific branch, useful for cloning large repos like linux kernel.

git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git --depth 1 --single-branch -b v6.10-rc6
@JohnRTitor
Copy link
Author

I meant more as: clone repo, gh pr checkout 5874, checkout cmake, git rebase In-line:lto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment