Difference between revisions of "Summary of Git Commands"

From PeformIQ Upgrade
Jump to navigation Jump to search
Line 23: Line 23:


=Stashes=
=Stashes=
A quick assise - need to do something on 'yyy':


* git stash save "wip for xxx"
* git stash save "wip for xxx"
Line 28: Line 30:
* ...
* ...
* git commit -a -m "xyzzy"
* git commit -a -m "xyzzy"
Get back to what I was working on...
* git stash apply
* git stash apply
* ...
* ...

Revision as of 19:03, 1 April 2012

Working with Branches

See http://gitref.org/branching/

  • git branch
  • git branch -a
  • git branch -r

Reviewing Remotes

See http://gitref.org/remotes/

  • git remote show origin
  • git ls-remote --heads origin

Grab one and use it

  • git fetch xxx
  • git checkout xxx
  • got branch

Stashes

A quick assise - need to do something on 'yyy':

  • git stash save "wip for xxx"
  • git checkout yyy
  • ...
  • git commit -a -m "xyzzy"

Get back to what I was working on...

  • git stash apply
  • ...

Queuing up stashes...

  • git stash list
  • git stash apply stash@{1}