I know that it is not a good idea to commit and push to a repository unfinished work.
Sometimes, however, I need to move workplace from company to home, and home to company. Having a temporary repository might solve the problem, but I think it needs some tiresome workaround:
$ cp ~/real_proejct ~/temp_project
$ cd ~/temp_project
$ git add . && git commit -m 'I am returning home' && git push temp_repo master
# Now I am home
$ cd ~/temp_project && git pull
# some edit
$ git add . && git commit -m 'I am going to company' && git push temp_repo origin
# In company
$ git pull
$ cp ~/temp_project ~/real_project
I think it's not a nice looking thing. In such case how do you deal with such situation?
- I don't work at home
- Use portable drive
- Do exact what the OP said
- Other