$ man jerome_

...

'git... what is ____?'

| Comments

some git notes i put together for reference

Rollback changes

  • undo last commit, put changes to staging
1
$ git reset --soft HEAD^
  • new message, change the last commit
1
$ git commit --amend -m
  • undo last commit and all changes
1
$ git reset --hard HEAD^
  • undo 2 commits and all changes
1
$ git reset --hard HEAD^^

Remotes

  • add new remotes
1
$ git remote add <name> <address>
  • remove remotes
1
$ git remote rm <name>
  • push to remotes
1
$ git push -u <name> <branch>
  • remote show
1
$ git remote show origin
  • clean-up deleted remote branches
1
$ git remote prune origin

Tagging

  • list all tags
1
$ git tag
  • checkout code commit
1
$ git checkout v0.0.1
  • add new tag
1
$ git tag -a v0.0.3 -m "version 0.0.3"
  • push new tags
1
$ git push --tags

Comments