Last Updated: February 25, 2016
·
611
· jairtrejo

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