Skip to content

Instantly share code, notes, and snippets.

@brianpursley
Last active August 26, 2021 12:27
Show Gist options
  • Save brianpursley/fbf59cd1e30c3cef3c11cce0c5379f70 to your computer and use it in GitHub Desktop.
Save brianpursley/fbf59cd1e30c3cef3c11cce0c5379f70 to your computer and use it in GitHub Desktop.
Git commands
# Function to squash last N commits
squash() { git reset --soft HEAD~$1; git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})"; }
# Merge changes from upstream into current branch
git fetch upstream && git merge upstream/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment