Skip to content

Instantly share code, notes, and snippets.

@giuliohome
Last active December 29, 2025 18:30
Show Gist options
  • Select an option

  • Save giuliohome/ecef3e6e69736feeb0d6fc7eda7b5d56 to your computer and use it in GitHub Desktop.

Select an option

Save giuliohome/ecef3e6e69736feeb0d6fc7eda7b5d56 to your computer and use it in GitHub Desktop.
Useful git commands
# interrupt a merge, e.g. because you want to switch the order of your commit <--> pull commands
git merge --abort
# undo the last commit
git reset --soft HEAD~
# check the commit history
git log
# save the password
git config --global credential.helper store
# Your local main branch is orphaned (no commits), but you have many files staged.
# First reset to fork/main, then commit your changes:
git reset --soft fork/main
git commit -m "Your commit message"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment