Kitaab

git tipsand tricks

dev git

published 2021-07-07 05:44

updated 2023-04-27 13:51

Drop commits out of current branch

  • git rebase -i master (interactively rebase from master)
  • drop the commits you dont want
  • git push origin <branch> -f

Cherry Picking

Diffing between local and remote repositories

  • git fetch <remote_repo> <remote_branach>
  • git diff --summary FETCH_HEAD

Or for a specific file:

  • git diff FETCH_HEAD -- <file>