Friday, July 27, 2012

How to use "git reset"

I found I can use "git reset" when I want to store my changes to the remote git repository temporarily.

Here is a few steps to do that: (assume we are in the "develop" branch now)

a. store
  a.1. git branch temp
  a.2. git checkout temp
  a.3. git commit -m "temporarily changes"
  a.4. git push origin/temp

b. resotre
  b.1 git pull origin/temp
  b.2 git checkout origin/temp
  b.3 git reset origin/develop
  b.4 git push origin :temp # remove the remote temp branch

then, we done! All changes is back to the stages.

No comments: