a few git magics

a few git magics

  • git status
  • git log -1 -2 -3
  • git reset –soft HEAD~1
  • git stash
  • git checkout -b branch-new
  • git push

rest master to prod

push local prod to remote master
make sure local prod is equal to remote one

  • git push origin +prod:master
  • git push origin +prod:test
  • git push origin +prod:dev

reset branch a to branch b

  • git checkout branch-a
  • git reset --hard branch-b

rest to remote branch

  • git reset --hard origin/master

rename a branch

  • git branch -m old-name new-name
  • git push origin :old-name new-name
  • git push origin -u new-name