Skip to content

Instantly share code, notes, and snippets.

@literat
Last active August 24, 2022 19:52
Show Gist options
  • Save literat/e39a3284f548f2794dcd542dd9d6b49f to your computer and use it in GitHub Desktop.
Save literat/e39a3284f548f2794dcd542dd9d6b49f to your computer and use it in GitHub Desktop.

Git History

https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History

Change multiple commits: git rebase -i HEAD~<number of commits>

'git pull --rebase --autostash' - this automatically stashes your local changes, pulls in new changes (and rebases if needed), and then pops the changes back off the stash.

Add repo to subdirectory

Force push Subtree

git push <remote> `git subtree split --prefix <local-folder> <local-branch>`:<remote-branch> --force

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