Skip to content

Instantly share code, notes, and snippets.

@rava-dosa
Last active December 2, 2017 05:41
Show Gist options
  • Save rava-dosa/76eb43abffebfbce045980eaae7a6f54 to your computer and use it in GitHub Desktop.
Save rava-dosa/76eb43abffebfbce045980eaae7a6f54 to your computer and use it in GitHub Desktop.
  for merging two commits
    git reset --soft "HEAD^"
      git commit --amend
  for merging more than two (say x wher x is integer)recent commits
   git reset --soft HEAD~x
  
  • git branch -f [branchname] commit x(where x is an integer)
  • git reset HEAD~1 not good
  • git revert branchname good
  • git checkout commitname
  • git checkout HEAD^
  • git checkout HEAD~x
  • copying some work from branch to some branch
  git cherry-pick c2 c4
  • interactive rebase
  git rebase -i
  • git rebase -i branchname --solution-ordering C3,C5,C4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment