Save your work to take it home without poluting your history
Sometimes I'm working on something at the office and want to keep working on it at home, but it is no quite ready for commiting. I just do:
$ git stash
$ git checkout -b WIP
$ git stash pop
$ git commit -m "WIP"
$ git push origin WIP
Which commits my changes to a branch named wip. Back at home I do:
$ git fetch
$ git checkout -b WIP
$ git merge origin/WIP
And I hack away, commiting if necessary. Back at work it's a simple matter of:
$ git pull
$ git rebase -i master
And after cleaning up my history and reorganizing my commits:
$ git checkout master
$ git merge WIP
$ git push origin :WIP
Written by Jair Trejo
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#