Skip to content

Instantly share code, notes, and snippets.

@stevemar
Last active January 23, 2024 19:11
Show Gist options
  • Select an option

  • Save stevemar/06ace005f82691435d0b to your computer and use it in GitHub Desktop.

Select an option

Save stevemar/06ace005f82691435d0b to your computer and use it in GitHub Desktop.
git cheatsheet

Remote Rebasing

Click "Rebase" button in the Gerrit UI under your patch set.

Local rebasing

  1. git review -d $PARENT_CHANGE_NUMBER
  2. git review -x $BROKEN_CHANGE_NUMBER
  3. fix the issues
  4. git add
  5. git cherry-pick --continue
  6. git review

Undo a git commit amend

  1. git reflog (to find the number)
  2. git reset --soft HEAD@{number}
  3. git commit -C HEAD@{number}

backporting a patch

  1. create a branch
  2. git checkout -b your_branch_name remotes/origin/stable/havana

3. hack hack hack 4 commit changes 5. git review stable/havana

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